You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
Can we have the possibility to have the current selected button as first parameter of setOnPositionChangedListener so we can use it more reliably than the position if we hide some buttons.
If i had the android developement level to do it correctly I would do it myself and pull request it but I am new to android developpement. Yet I Tried but it's obviously bugged (you can see what i'm requesting in the atached file)
I just checked the source code, and I don't see a way to get the last position of the buttons from the listener. Thus, your feature request is a valid point.
However, the reason I did not include the previous position of the button when the selection is changed is because I failed to see a valid use case for it. Can you explain why you need this functionality and why you think it's beneficial to the repository?
This an easy fix to make, and I see two possible ways of fixing. First, moving the listener call to before the new position is updated, that way this.position() will return the last position. Second, actually add a new parameter to the listener for the previous position. Not sure which method I prefer.
Since this is an easy fix to make, I'm going to leave it for someone else to do. It doesn't take much knowledge into Android development in order to make the change. It's mostly understanding Java code and I think it'll be a good first issue for someone to complete.
Hello,
Can we have the possibility to have the current selected button as first parameter of setOnPositionChangedListener so we can use it more reliably than the position if we hide some buttons.
If i had the android developement level to do it correctly I would do it myself and pull request it but I am new to android developpement. Yet I Tried but it's obviously bugged (you can see what i'm requesting in the atached file)
SegmentedButton.zip
The text was updated successfully, but these errors were encountered: