-
Notifications
You must be signed in to change notification settings - Fork 550
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
Fix issue with resume buttons not scaling as expected #4899
Fix issue with resume buttons not scaling as expected #4899
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @KevinGitonga.
Two things:
- Does this actually fix When reading text size is extra large, resume lesson page and revision tabs content is seen in normal size #4362? It seems that issue is tied to also scaling the "resume lesson" screen and isn't particularly tied to the buttons.
- Won't this '0dp' fix only work if the button is used in a constraint layout (since 0dp means 'match constraint')? I'm concerned with defaulting it at such a high level in styles since other uses of the button (both now and in the future) could lead to the button not displaying at all. Similarly, we need to make sure the min size of buttons is always at least 48dp per accessibility requirements, so you may need to add a
minWidth
to the styles as well.
Thanks @BenHenning they seem related basing on the screenshots on the PR will double check on the revision tab which is mentioned on issue #4362 and provide update on this. |
Hey @BenHenning |
I'm not sure that fully addresses point (2) actually. Defaulting to using constraint layout is problematic since it won't be clear to users of this style in the future that the button must be in a constraint layout, leading to a potentially brittle style. It also occurs to me that the current style very much wants the button to be the size it's set to (as the minimum is set to the same size). Perhaps we should be considering alternatives to resizing such as wrapping the buttons. Per https://m2.material.io/components/buttons#anatomy button text shouldn't ever wrap in Material design as it can hurt text legibility, so wrapping would probably be more in-line with Material as well. |
Hi @KevinGitonga, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue. |
Explanation
Fixes #4710 and #3833. The second issue was closed as it is possibly a duplicate of #4710
Updating width on both the buttons width 0dp actually gives them equal width enabling the button text and child drawables to scale as expected on max display and font config. Main issue is that the currently used width "144dp" doesn't work when the device's display and font config is set to max. This update works better and is per @adhiamboperes comments on previous PR submitted, The previous fix involved using a LinearLayout which had other caveats.
Essential Checklist
For UI-specific PRs only
If your PR includes UI-related changes, then:
Before and after screenshots demo
Nexus 5x API 29
Google Pixel 3xl