RadioRealButton
RadioRealButton copied to clipboard
Change the button position before all the things
One problem that I have today is: If I put a code that is a little bit slow, inside the radioGroup listener, the button position only changes when the processing finishes. This is very awkward when it comes to user experience. Could you change the button position before anything?
radioGroup.setOnClickedButtonListener(RadioRealButtonGroup.OnClickedButtonListener {
button, position ->
if(position != currentPosition) {
when (button) {
ratingButton -> {
playersInFastAdapter.clear()
playersRating?.forEach {
playersInFastAdapter.add(PlayerListRankingComplete(this, it, App.CARD_RANKING_RATING_LIST))
}
}
}
New selected position should be set before calling listeners (as a general rule)