Accessibility : Notification Improvements #10799
Conversation
…t important for accessibility.
Also increased touch target row container that's within switch control used for notification settings.
|
You can test the changes on this Pull Request by downloading the APK here. |
Did this programmatically as styling it was being proven to be more difficult than expected.
The content description for the toolbar's title was being set before the toolbar's TextView was even populated so in essence, so child TextView was present. This logic was moved to the initialization function that sets the title on toolbar which creates the TextView that would further get the content description.
...rc/main/java/org/wordpress/android/ui/prefs/notifications/NotificationsSettingsFragment.java
Outdated
Show resolved
Hide resolved
|
Howdy folks! I'm freezing |
shiki
left a comment
There was a problem hiding this comment.
Looking good, @jd-alexander. Sorry for not getting to this earlier. 😞
I really like your commit messages. And also, thank you for the arrows in the screenshots. They're really great!
I have a few comments. Please let me know what you think. 🙂
...rc/main/java/org/wordpress/android/ui/prefs/notifications/NotificationsSettingsFragment.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/wordpress/android/ui/prefs/notifications/NotificationsSettingsFragment.java
Outdated
Show resolved
Hide resolved
| mSearchMenuItem = menu.findItem(R.id.menu_notifications_settings_search); | ||
| mSearchView = (SearchView) mSearchMenuItem.getActionView(); | ||
| mSearchView.setQueryHint(getString(R.string.search_sites)); | ||
| setSearchViewHintColor(); |
There was a problem hiding this comment.
I noticed that you changed this from your first implementation in 1989207. I think we should do it that way and make it a static too. Possibly shallow reasons:
- A
private voidcan indicate that this method can and should be used multiple times but it doesn't really need to be. An instance method also adds a bit of cognitive overhead to analyze how the state changes in this class. - A
static voidwould imply that it's a utility method, which this one is - It's arguably better for readability when you're scanning the contents of
onCreateOptionsMenu
Sample untested code:
private static void setSearchViewHintColor(@NonNull SearchView searchView, @ColorRes int colorResId) {
final Context context = searchView.getContext();
if (context != null) {
((EditText) searchView.findViewById(androidx.appcompat.R.id.search_src_text))
.setHintTextColor(ContextCompat.getColor(context, colorResId));
}
}What do you think? 🙂
There was a problem hiding this comment.
Thanks. Yes, your reasoning is sound and I was thinking of making it a utility method at first hence the first implementation. Since its a utility method wouldn't it make sense to put it somewhere else so if another person wants to utilize it, it's accessible? Let me know what you think about that.
I made these changes so once I get your final opinion on this I will push it.
There was a problem hiding this comment.
Since its a utility method wouldn't it make sense to put it somewhere else so if another person wants to utilize it, it's accessible?
I'm okay with keeping it private here and make it public later when we violate the Rule of Three. But up to you!
There was a problem hiding this comment.
Okay, thanks for citing that rule! Yes, it's best to make it public at that time 👍
Fixes #10735 #10736
Some of the issues described in the above issue were ignored due to further analysis that deemed them not being necessary for resolution. Most notably, some of the accessibility prompts for the Accessibility Scanner were for items that don't need to have to have larger touch targets as they were easy enough to select for announcement and they wouldn't be clickable. eg. some of the header text.
Main
TalkBack Audit
Settings
Accessibility Scanner Audit
Main Area - Your Sites-
org.wordpress.android:id/header_text- Text contrastFollowed Sites - Notification Dialog -

org.wordpress.android:id/notifications_new_posts_descriptionThe item's text contrast ratio is 4.20. This ratio is based on an estimated foreground color of
#787C82and an estimated background color of#FFFFFF. Consider using a contrast ratio greater than 4.50 for small text, or 3.00 for large text.Your Sites - Notification Screen
This item's height is 44dp. Consider making the height of this touch target 48dp or larger.
Notification Search
org.wordpress.android:id/search_src_text- Text contrastThe item's text contrast ratio is 2.95. This ratio is based on an estimated foreground color of #80B0C4 and an estimated background color of #6088. Consider increasing this item's text contrast ratio to 3.00 or greater.
TalkBack Audit
Notifications On Switch
PR submission checklist:
I have considered adding unit tests where possible.
I have considered if this change warrants user-facing release notes and have added them to
RELEASE-NOTES.txtif necessary.