-
Notifications
You must be signed in to change notification settings - Fork 528
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 #4361: Continue button is not aligned properly when reading text size in extra large #4385
Conversation
Thanks @Ryggs! There are some aspects of this PR that should be changed:
|
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.
@Ryggs PTAL, Thanks.
app/src/main/res/values/dimens.xml
Outdated
@@ -377,7 +377,7 @@ | |||
<dimen name="general_button_item_split_view_margin_top_left">20dp</dimen> | |||
<dimen name="general_button_item_split_view_margin_top_right">68dp</dimen> | |||
<dimen name="general_button_item_margin_top">20dp</dimen> | |||
<dimen name="continue_submit_button_width">88dp</dimen> | |||
<dimen name="continue_submit_button_width">180dp</dimen> |
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.
I think we should change this behaviour.
Currently we are keeping the width of button to be fixed and for large fonts we have increased that to 180dp but this will start creating issues for smaller font settings.
Also ideally the width should be wrap_content
and other attributes like margin, padding, fontSize should handle the UI.
For this specific case following changes to the Continue Button
should mostly fix the issue:
- Instead of fixed width as 180dp we should make
layout_width
aswrap_content
. - We should keep a padding of
10dp
as per mocks - https://xd.adobe.com/view/3dca36c2-5115-419c-b25e-0f10526b077c-6899/screen/0fe704c1-f8c7-4abc-8b04-2a0ed1285db4/
To test this fully make sure you generate screenshots of small, medium as well as large font size.
You might need to look at this link about how to use mocks correctly: https://github.com/oppia/oppia-android/wiki/Working-on-UI
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.
@Ryggs when addressing comments, please reply rather than marking them as resolved (generally, only the origin comment author should resolve their comment since they need to check that you've addressed the original point, and it's often easy to miss comments that were closed by other people).
That being said, has @rt4914's comment been fully addressed?
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.
@rt4914 when you say we replace the 180dp dimension and make the layout_width as wrap_content, should this be in the dimens folder replacing the "continue_submit_button_width" ?
The current Padding is 88dp and changing it to 188dp accomodates all screen sizes. Take a look at the updated comment on the PR. Thanks
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.
@Ryggs 188dp might work for some screens or maybe all but it is actually not the correct way.
The approach should be to avoid giving fixed widths to buttons.
I suggest removing continue_submit_button_width
fully and instead using wrap_content
in the layout file where this button has been created.
Also we should keep a padding of 10dp as per mocks - https://xd.adobe.com/view/3dca36c2-5115-419c-b25e-0f10526b077c-6899/screen/0fe704c1-f8c7-4abc-8b04-2a0ed1285db4/
To test this fully make sure you generate screenshots of small, medium as well as large font size.
You might need to look at this link about how to use mocks correctly: https://github.com/oppia/oppia-android/wiki/Working-on-UI
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.
@Ryggs Assign it back to me whenever you need a reply.
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.
Hello Rajat, this is the error I am getting after replacing continue_submit_button_width fully and instead using wrap_content in the layout file
THis is how I did it.
Replaced the line calling the max_width dimension and replaced with app_layout_width and used wrap_content as that is the only way to do it perhaps?
I'll appreciate your feedback PTAL
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.
@Ryggs I believe attributes are case sensitive. It seems like you might've unintentionally capitalized the 'w' for width. Plus, shouldn't this be an android not an app attribute? E.g. android:layout_width
.
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.
Let me try this out now
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.
@Ryggs You can remove this value from all dimens
now as it might not be getting used.
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.
Hi @rt4914 I have removed this value. PTAL
Hi @Ryggs, 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. |
Hey @rt4914 can I work on this? |
Hi @Ryggs, 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. |
Hi @Ryggs, 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. |
Hi @Ryggs, 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. |
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.
Updated fix from using maxWitdth to wrap_content att for Continue Button
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.
@Ryggs PTAL
app/src/main/res/values/dimens.xml
Outdated
@@ -377,7 +377,7 @@ | |||
<dimen name="general_button_item_split_view_margin_top_left">20dp</dimen> | |||
<dimen name="general_button_item_split_view_margin_top_right">68dp</dimen> | |||
<dimen name="general_button_item_margin_top">20dp</dimen> | |||
<dimen name="continue_submit_button_width">88dp</dimen> | |||
<dimen name="continue_submit_button_width">180dp</dimen> |
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.
@Ryggs You can remove this value from all dimens
now as it might not be getting used.
Hi @rt4914 I made the requested changes. PTAL |
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.
LGTM, Thanks.
Explanation
Fixes #4361 Continue button is not aligned properly when reading text size is extra large
This pr fixes :--
Essential Checklist
For UI-specific PRs only
If your PR includes UI-related changes, then:
Changes made
Demo Video
fix_continue_button_issue.mp4