Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Accessibility in Android

Accessibility in Android

Practicing accessible engineering is the right thing to do. It's also required for anyone designing apps for governments or large institutions. Ensure your apps are as accessible as they can be.

Chetan Sachdeva

July 09, 2023
Tweet

More Decks by Chetan Sachdeva

Other Decks in Technology

Transcript

  1. Talkback is used for Accessibility in Android. Steps to enable

    Talkback: 1. On your device, open Settings . 2. Select Accessibility > TalkBack. 3. Turn Use TalkBack on or off. 4. Select Ok. Reference Link
  2. Make apps more accessible link Easy ways: • Increase text

    visibility ◦ Set the color contrast ratio to at least 3:1. • Use large, simple controls ◦ Each interactive UI element have a focusable area, or touch target size, of at least 48dpx48dp. Larger is even better. • Describe each UI element ◦ Include description in the element's contentDescription attribute to describe element’s purpose.
  3. Headings within text link • Headings are used to summarize

    groups of text that appear on screen. • If a particular View element represents a heading, you can indicate its purpose for accessibility services by setting the element's android:accessibilityHeading=true.
  4. Decorative elements link • If an element in your UI

    exists only for visual spacing or visual appearance purposes, set its android:importantForAccessibility="no".
  5. Make all actions accessible link • A user of TalkBack,

    Voice Access, or Switch Access might need alternate ways to complete certain user flows within the app. • For example, if your app allows users to swipe on an item, you can also expose the functionality through a custom accessibility action, like this:
  6. Make available actions understandable link • When a view supports

    actions such as touch & hold, an accessibility service such as TalkBack announces it as "Double tap and hold to long press." • To make this announcement more descriptive, "Double tap and hold to favorite," will help users understand the purpose of the action.
  7. Define custom events (overriding) link • For every view-based callback

    you override, you also need to redefine the corresponding accessibility action by overriding ViewCompat.replaceAccessibilityAction(). • In your app's tests, you can validate the behavior of these redefined actions by calling ViewCompat.performAccessibilityAction().
  8. How this principle can work for TriSwitch objects link •

    Tapping a TriSwitch object cycles through 3 possible states. Therefore, corresponding ACTION_CLICK accessibility action needs to be updated.
  9. CO Accessibility Wiki link • Talkback for images • Heading-by-heading

    controls • Announcing Links • Skip talkback announcement • Keyboard tab order • Requesting focus and announcing explicitly • Contrast Issues
  10. Android Accessibility Scanner app Scanner audits features by taking snapshots:

    • Content labels • Touch target size • Clickable items • Color contrast for text and images Watch: Accessibility scanner - Accessibility on Android
  11. Accessibility test framework and Espresso • Accessibility Test Framework is

    a library that checks Android UI to identify area of improvement related to accessibility • Integrate ATF into existing Espresso tests with AccessibilityChecks.enable () Watch: Accessibility test framework and Espresso - Accessibility on Android
  12. References • Principles for improving app accessibility • Android Accessibility

    Codelab • Testing Accessibility • Mobile Android Accessibility Thank you! Chetan Sachdeva ([email protected])