} binding.twoLineView.setOnClickListener {




Download 1,09 Mb.
bet5/12
Sana17.12.2023
Hajmi1,09 Mb.
#121185
1   2   3   4   5   6   7   8   9   ...   12
Bog'liq
Matkarimov Sardor kurs ishi

}
binding.twoLineView.setOnClickListener {
if (selectedWord != null && selectedView != null) {
trues[binding.chipGroup.indexOfChild(selectedView?.root)] =
getWordType(selectedWord) == WordLineType.TWO_LINE
drawLine(selectedView, WordLineType.TWO_LINE)
}
}
binding.waveLineView.setOnClickListener {
if (selectedWord != null && selectedView != null) {
trues[binding.chipGroup.indexOfChild(selectedView?.root)] =
getWordType(selectedWord) == WordLineType.WAVE_LINE
drawLine(selectedView, WordLineType.WAVE_LINE)
}
}
binding.dashedLineView.setOnClickListener {
if (selectedWord != null && selectedView != null) {
trues[binding.chipGroup.indexOfChild(selectedView?.root)] =
getWordType(selectedWord) == WordLineType.DASHED_LINE
drawLine(selectedView, WordLineType.DASHED_LINE)
}
}
binding.spotLineView.setOnClickListener {
if (selectedWord != null && selectedView != null) {
trues[binding.chipGroup.indexOfChild(selectedView?.root)] =
getWordType(selectedWord) == WordLineType.SPOT_LINE
drawLine(selectedView, WordLineType.SPOT_LINE)
}
}

binding.checkButton.setOnClickListener {
var br = false
for (i in trues) {
if (!i) {
br = true
break
}
}
if (br) {
AlertDialog.Builder(this)
.setTitle("Natija:")
.setMessage("Javob noto'g'ri qayta urinib ko'ring!")
.setNegativeButton("OK") { _, _ -> }
.show()
} else {
val dialog = AlertDialog.Builder(this)
.setTitle("Natija:")
.setNegativeButton("OK") { _, _ -> }
.setMessage("Javob to'g'ri!")
if (binding.backButton.visibility == View.VISIBLE) {
dialog.setNeutralButton("OLDINGI") { _, _ -> binding.backButton.performClick() }
}
if (binding.nextButton.visibility == View.VISIBLE) {
dialog.setPositiveButton("KEYINGI") { _, _ -> binding.nextButton.performClick() }
}
dialog.show()
}

Download 1,09 Mb.
1   2   3   4   5   6   7   8   9   ...   12




Download 1,09 Mb.

Bosh sahifa
Aloqalar

    Bosh sahifa



} binding.twoLineView.setOnClickListener {

Download 1,09 Mb.