|
}
binding.twoLineView.setOnClickListener {
|
bet | 5/12 | Sana | 17.12.2023 | Hajmi | 1,09 Mb. | | #121185 |
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()
}
|
| |