-
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 resume lesson fragment buttons scaling issue #4891
Fix resume lesson fragment buttons scaling issue #4891
Conversation
Hi @BenHenning the main fix for this issue seems to be replacing the constraint layout with a linear layout as this automatically fixes the weird cutting of the buttons when display and font are scaled to max. The button text is expanded horizontally which can be fixed by adding setting maxLines to "1" which instead add ellipsis to the text. The ellipsis can in turn be prevented when the device is scaled by reducing the large paddings and margins on the views. My thoughts are this issue might be caused by an internal issue with scaling when using constraint layout although i am not sure about this. PTAL and share your thoughts. |
@KevinGitonga, I think ConstraintLayout scales better in these situations than LinearLayout. These two buttons in one container can scale to fit the available space if we give them both an equal and flexible width value - i.e. The default text behaviour in constraint layout is to overflow to the next line, which I think we should keep since elipsizing on really small screens might mean maybe just 2 characters of the whole text being displayed, and no one will know what the button is supposed to do. You can test this by chaining both buttons to each other and each to the start/end of the container as appropriate. |
Hi @adhiamboperes thanks, giving 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. Also on the ConstraintLayout it is better suited since LinearLayout tends to split the text into multiple lines when scaled to max display and font. Main issue i would for sure say was usage of fixed width in dp. Updating this PR to use changes based on your comment since it makes more sense and also involves less changes to the existing codebase. |
785ae5d
to
90347ac
Compare
…ixes issue with buttons scaling.
Fixes #4710, #4362 and also #3833. The second 2 consecutive issues were closed as they might be possibly duplicates of #4710
Essential Checklist
For UI-specific PRs only
If your PR includes UI-related changes, then:
Google Pixel 3XL
| 