Skip to content

Accessibility : Notification Improvements #10799

Merged
shiki merged 8 commits intodevelopfrom
issue/10735-accessibility-notifications
Nov 27, 2019
Merged

Accessibility : Notification Improvements #10799
shiki merged 8 commits intodevelopfrom
issue/10735-accessibility-notifications

Conversation

@jd-alexander
Copy link
Copy Markdown
Contributor

@jd-alexander jd-alexander commented Nov 14, 2019

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

Screenshot_20191104-191209

  • The icon(s) in the list item shouldn't be read since the are profile pictures and the notification content has the name of the person.

Settings

Accessibility Scanner Audit

screenshot_WordPress_ 0,490 1440,622 _4294967305_2019-11-04-19_47_31

Main Area - Your Sites- org.wordpress.android:id/header_text - Text contrast

  • The item's text contrast ratio is 1.98. This ratio is based on an estimated foreground color of #B2B2B2 and an estimated background color of #F6F7F7. Consider increasing this item's text contrast ratio to 3.00 or greater.

Followed Sites - Notification Dialog -
screenshot_WordPress_2019-11-04-19_49_15

  • New posts - Description - Text contrast
    org.wordpress.android:id/notifications_new_posts_description

The item's text contrast ratio is 4.20. This ratio is based on an estimated foreground color of #787C82 and 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

  • * Notification Setting Pop up Dialog - org.wordpress.android:id/row_containerTouch target

This item's height is 44dp. Consider making the height of this touch target 48dp or larger.

Notification Search

Before After
Before 2019-10-02 13 33 28
  • Search Text - org.wordpress.android:id/search_src_text - Text contrast

The 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
  • The message being read wasn't descriptive. It read "On, On Switch". It should read "Notifications, On Switch"
Before After
Before after_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.txt if necessary.

Also increased touch target row container that's within switch control used for notification settings.
@peril-wordpress-mobile
Copy link
Copy Markdown

peril-wordpress-mobile bot commented Nov 14, 2019

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.
@jd-alexander jd-alexander marked this pull request as ready for review November 15, 2019 19:58
@jd-alexander jd-alexander requested a review from shiki November 15, 2019 19:59
@jkmassel
Copy link
Copy Markdown
Contributor

Howdy folks! I'm freezing 13.7 today, so this is being bumped to 13.8. If you'd like it to go out as part of 13.7, please target release/13.7 for this PR, and DM me once it's merged – I'll be happy to cut a new beta release!

@jkmassel jkmassel modified the milestones: 13.7, 13.8 Nov 18, 2019
Copy link
Copy Markdown
Contributor

@shiki shiki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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. 🙂

mSearchMenuItem = menu.findItem(R.id.menu_notifications_settings_search);
mSearchView = (SearchView) mSearchMenuItem.getActionView();
mSearchView.setQueryHint(getString(R.string.search_sites));
setSearchViewHintColor();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. A private void can 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.
  2. A static void would imply that it's a utility method, which this one is
  3. 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? 🙂

Copy link
Copy Markdown
Contributor Author

@jd-alexander jd-alexander Nov 26, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, thanks for citing that rule! Yes, it's best to make it public at that time 👍

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved here fe68ca6

@jd-alexander jd-alexander requested a review from shiki November 26, 2019 17:30
Copy link
Copy Markdown
Contributor

@shiki shiki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great. Just that one thing left!

@jd-alexander jd-alexander requested a review from shiki November 26, 2019 20:33
@shiki shiki merged commit 429f5a1 into develop Nov 27, 2019
@shiki shiki deleted the issue/10735-accessibility-notifications branch November 27, 2019 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Accessibility: Notifications

3 participants