Closed draskosaric closed 4 years ago
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!
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: