-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Button styling improvements #5773
Conversation
@alyblenkin please take a look at the changes and let me know what you think about the new font size. I used the same size as we already had in the main menu buttons as @lognaturel proposed. |
First of all, removing the bold font makes it so much easier to read! I think the button font size for the menu works really well. However, in the form-filling experience, the increased font size of the buttons in comparison to the question font size looks too drastically different. And we want to try to avoid situations where the button label text goes on two lines because it almost doubles the width of the buttons, like in the example you shared. It was worthwhile testing the larger font size as part of the new M3 button changes, but I don't think we should make them the same size as the menu buttons. We originally increased the height as part of some of the other button updates because a user brought up that the touch area is sometimes difficult for larger fingers. Unfortunately, increasing the height and font size so it is unified creates other issues, with the button labels being too long and taking up too much space on smaller devices. Proposal: To make the button and font size ratio feel more unified, I think we need to decrease the button height and font size back to what we had before. We also wanted to explore using a lighter grey for the outlined button. The dark outline is problematic with the "Back" and "Next" buttons in particular, and it can be distracting from the form. Maybe something like #C4C4C4 would be slightly lighter but still visible. |
Yes
Sorry for the slow reply! I don’t think they look like disabled buttons because of the blue text. However, #C4C4C4 doesn’t pass for accessibility in terms of contrast. I assume that a lot of companies, like Google, use a lighter outline but rely on text contrast. I also don’t want this work to eat too much into the other features we have planned for this release. So I think we should go forward with the slightly softer version, and we can always change it as we navigate the wonderful world of implementing M3 styling :) |
What about the dark mode? What color should be used there? |
Dark mode is fine! We don't want to make any changes there. |
c3df66a
to
c9841a7
Compare
c9841a7
to
9ef087b
Compare
@alyblenkin according to https://github.com/material-components/material-components-android/blob/master/docs/components/Button.md#container-attributes-3 the |
Ah perfect! I didn't know we had the Material colours implemented. |
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.
Looks good! I've left a comment about one small tweak I'd like.
One thing I was thinking: did you consider introducing a theme for widgets that overrides the default button style instead of the more "programmatic" approach (with adjustFontSize
)? It might be worth experimenting with. The end result would be the same (that buttons would all have a different default style from the rest of the app), but it would still allow us to have Button
views in widgets that set their own text style which the current approach would not allow.
collect_app/src/main/java/org/odk/collect/android/widgets/QuestionWidget.java
Outdated
Show resolved
Hide resolved
|
Ah good point! We'd still need a programmatic part to update the theme which would probably be pretty messy. |
Yes if it's a button with a border (the outline buttons with white background) then the color should be updated across the app. If there were buttons without borders it's not in the scope of this pr. Should they have borders I don't know I think it's ok as it is. |
The form map icon/button has a darker outline than other buttons. Is this in the scope of this PR? |
So yes those also should be updated. I've just fixed that so it should be fine now. |
It's a really good point @dbemke and it has caused a lot of confusion in the UX world! Cancel buttons are navigation links, so they don't need an outline. For example: Navigation links (without an outline)
You're not changing any information here, you are simply navigating back to the previous state. Action buttons (with outline)
The key here is the action button is changing the data or manipulating something. |
Tested with Success! Verified on device with Android 8.1, 10 Verified cases:
|
Tested with Success! Verified on device with Android 13 |
Closes #5735
Why is this the best possible solution? Were any other approaches considered?
Nothing to discuss here.
How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?
Things that I have changed:
Please review all buttons to make sure they look as expected.
Do we need any specific form for testing your changes? If so, please attach one.
No.
Does this change require updates to documentation? If so, please file an issue here and include the link below.
No.
Before submitting this PR, please make sure you have:
./gradlew checkAll
and confirmed all checks still pass OR confirm CircleCI build passes and run./gradlew connectedDebugAndroidTest
locally.