-
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
SegmentedButtonGroup background is being ignored #14
Comments
I somewhat understand the problem you're describing, but do you mind giving me a simple example I can rerun. (Sounds like we should only need the layout XML for the example) Thanks! |
Thanks for responding so quickly!
|
No problem. So at first glance, I don't see anything wrong with the code, so it seems like a valid bug. I'm a bit confused that I have a similar test case as shown here: The interesting thing is that it is showing the white background and not the gray one. Anyway, I'll play around with this within the next few days to see if I can reproduce. There's a possibility that maybe the device you're using is having problems. I'll keep you up to date with my findings. |
Alright, I figured it out. Took me a little while to understand what was going on. The issue is that you have Here is the PR for the Here's the relevant line of code to explain what So, the rounded attribute will round both sides of the button regardless of it's position. So the buttons were being rounded and that's why the background was bleeding through, so to speak. The purpose of the Just so I'm clear, you should remove the rounded attribute from the buttons and then it all works as expected. So, with that in mind, I think there are some improvements that could be made to the documentation, such as:
I'll be leaving this issue open for others to reference until PRs are submitted for the following changes. I won't have time to do this so I'll leave it for anyone that is interested. |
Thanks for replying and sorry for my late response. I have some deadlines, if I have time left I will look at fixing this problem in the code. For now a work-a-round is to have a viewgroup container with the background color as desired. That way I can still have rounded buttons! |
No problem. I'm a bit confused by your message. In terms of code/functionality, what you are wanting can be done, the primary issue is the confusion in documentation. If you take out the So there should be no need for a workaround to get your code working. Does that make sense? The functionality you want is shown in the examples with Yes/No/maybe just with different styling and such. |
ah, you are right using "app:selectedButtonRadius" fixed this issue for me! Thanks for responding man ! |
Added additional documentation in 3.1.5 |
When creating rounded buttons the background of the left-overs is from the parent and not the SegmentedButtonGroup!
setting android:background="COLOR" on SegmentedButtonGroup doesnt change this fact
The text was updated successfully, but these errors were encountered: