i have a lots of child buttons in a toggle group. And i want that whenever one of the child is clicked, make the whole toggle group not clickable.
Asked
Active
Viewed 270 times
1 Answers
0
You can use the OnButtonCheckedListener()
listener:
materialButtonToggleGroup.addOnButtonCheckedListener { group, checkedId, isChecked ->
for (i in 0 until materialButtonToggleGroup.childCount) {
materialButtonToggleGroup.getChildAt(i).isClickable = false
}
}

Gabriele Mariotti
- 320,139
- 94
- 887
- 841