-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SegmentedButton visibility issue #18
Comments
Hmm, I don't doubt this is a bug. I haven't done much testing or experimentation with showing or hiding buttons. You're welcome to tackle this bug if you want, otherwise I'll get to it when I find some time (it's been hectic lately). By the way, this was a good bug report! Just enough detail and explanation |
Thank you very much! |
Little experimentation was done with showing or hiding buttons and the functionality. It was extremely buggy, with animations not working correctly and dividers not updating properly. This PR adds proper support for showing and hiding buttons via SegmentedButton.setVisibility function. Fixes #18
FYI, I addressed this in #20. I tested on API 19, 21, 26, & 29 and it worked as expected. New version of SegmentedButton will be released when #19 is merged in. This is likely going to be sometime next week. A couple of notes:
|
Thanks! |
Great, it's working now! |
I think I found the bug with this control when button is removed, ie its visibility is set to
View.Gone
, since the number of dividers stays the same.This is the initial state of SegmentButtonGroup view:
Now, I wish to change the visibility of last button (red ball and its id is
"other"
) every time I click on "Show/hide" button:No matter if I use the last line (in
onClickListener
example above is commented)segmented_choices.requestLayout()
or not, I get the following layout:As you can see, the number of dividers stays the same. Is there a way to fix it?
XML layout is very simple:
The text was updated successfully, but these errors were encountered: