Issue
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.
Solution
You can use the OnButtonCheckedListener()
listener:
materialButtonToggleGroup.addOnButtonCheckedListener { group, checkedId, isChecked ->
for (i in 0 until materialButtonToggleGroup.childCount) {
materialButtonToggleGroup.getChildAt(i).isClickable = false
}
}
Answered By - Gabriele Mariotti
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.