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

Accessibility: Building an Inclusive Android Ap...

Aung Kyaw Paing
November 08, 2024
93

Accessibility: Building an Inclusive Android Application

Aung Kyaw Paing

November 08, 2024
Tweet

Transcript

  1. Accessibility: Building an Inclusive Mobile Application Aung Kyaw Paing Senior

    Consultant @ thoughtworks | GDE Android aungkyawpaing.dev
  2. “Because I'm hearing-impaired, emails are a tremendously valuable tool because

    of the precision that you get, I can read what's typed as opposed to straining to hear what's being said.” - Vint Cerf, one of “the fathers of the Internet”
  3. But sadly for many of us, accessibility is an afterthought.

    “It's a crime that the most versatile device on the planet, the computer, has not adapted well to people who need help, who need assistive technology” Vint Cerf, one of “the fathers of the Internet”
  4. “The majority of blind people, for instance, are employed to

    work with a computer, but inaccessible sites contribute to them losing, on average, 30.4% of time. And that time costs so much: promotions and pay rises, company productivity, the public perception that PWDs are not valuable company assets and should not be hired.” Ref: The Digital Divide No One Has Talked About: PWDs And The Internet https://www.ricemedia.co/current-affairs-features-digital-divide-singapor e-pwds-internet-web-accessibility/
  5. You’re losing potential revenue! If your software is inaccessible or

    unusable, the customer can simply choose to “click away”. In UK, retailers lose out on £17 billion in 2019 by failing to meet the online needs of shoppers with disabilities. Ref:The Click-Away Pound Survey
  6. Some country has laws! - Americans with Disabilities Act of

    1990 - Australia’s Disability Discrimination Act of 1992 - United Kingdom’s Equality Act of 2010 - European accessibility act, 2012 - Singapore’s Enabling Master Plan 2030 (EMP 2030)
  7. Or it could just be for Features like adaptive design,

    closed captions helps everyone Better user experience Inclusive brand image Global spending power of disabled households has risen to $13 trillion per year (Ref: 2020 Global Economics of Disability Report)
  8. Naughty Dog discovered a lot of sighted players were using

    the feature, auto pickup, because they didn’t want to spend so much time treasure hunting. - Imaginary Worlds, episode 181, “Playing Blind”
  9. Which of the following do you think is the primary

    reason that many developers do not create accessible web sites? Ref: WebAIM screen reader user survey https://webaim.org/projects/screenreadersurvey8
  10. You don’t have to reinvent the wheels. Android already has

    accessibility services that interacts with these assistive technologies.
  11. 18 Talkback - Screen reader services - Describe content out

    aloud - Users interact with gestures (single tap, double tap etc)
  12. 19 BrailleBack - Integration with braille display - Used together

    with Talkback - User interact using keys on display
  13. 20 Switch Access - Switches instead of taps - Scan

    items and highlight - User can interact with switches
  14. 21 Voice Access - Control hand-free - Show labels and

    grids - User interact device with voice commands
  15. Touchable area must have 48dp size In addition to making

    it easier to tap on a component, switch access can scan a point on the screen to interact with it. Smaller touch size will have problem with this feature.
  16. Touchable area must have 48dp size Making touch are bigger

    doesn’t means you have to break your UI. You can use padding to expand the touchable area without making the component looks bigger.
  17. Describe your image Provide a screen readable description of your

    image and actions. Make sure it’s also translated for all the languages you supports.
  18. Describe your image However, if an image is just for

    visual or stylistic purpose. Tell the system to skip these elements.
  19. Describe your image If it’s user-generated content, you can provide

    a way for users to add/edit alternate text of the images. You can also use large language model like Gemini to generate the description and prefill by default.
  20. Describe clicks Describe what would happen if a user perform

    a click interaction on the component as this prevent misclicks. “Double Tap to open Privacy Policy Page”
  21. Describe state changes Alert the user for state changes on

    interaction. States can be YES/NO, ON/OFF boolean values or there can also be more than two in component like sliders. Image ref: https://medium.com/google-develo per-experts/state-descriptions-on- android-b2029283871f
  22. Describe state change (for Boolean States ) MicrophoneControl( modifier =

    Modifier.toggleable(isMicrophoneOn) { isMicrophoneOn = !isMicrophoneOn } )
  23. Replace complex gesture (e.g swipe) with accessibility actions Accessibility services

    like talkback uses swipe to focus next/previous component. This can override your swipe gestures. Therefore, we need to replace them with click actions or add custom accessibility actions.
  24. If you only have one complex gesture Row( modifier =

    Modifier // only apply click in semantics tree (i.e for a11y services) .semantics { onClick(label = "Delete") { deleteMail() return@onClick true } } ) { // Render Contents }
  25. If you only have multiple complex gesture or it already

    has click action Row( modifier = Modifier.semantics { customActions = listOf( CustomAccessibilityAction("Action 1") { true }, CustomAccessibilityAction("Action 2") { true } ) } ) { // Render Contents }
  26. Merge components Merge semantically relevant components together to make screen

    readers easier to navigate with fewer taps. You must always merge items in your list + “Checkbox Checked” “With Soup” “Checkbox With Soup - Checked”
  27. Move child actions up to merged parents If the child

    component has actions available, the accessibility service will still focus on them for interaction. So, we have to remove these actions from child items and move them to merged parent or replace them with custom accessibility actions.
  28. When only one child has click action Row( modifier =

    Modifier.semantics(mergeDescendants = true) { onClick(label = "Bookmark") { true } } ) { ... // clearAndSetSemantics remove accessibility click action from Button Button(modifier = Modifier.clearAndSetSemantics{}) }
  29. When multiple child or parent also has click actions Row(

    modifier = Modifier.semantics { customActions = listOf( CustomAccessibilityAction("Action 1") { true }, CustomAccessibilityAction("Action 2") { true } ) } ) { .. Button1(modifier = Modifier.clearAndSetSemantics{}) Button2(modifier = Modifier.clearAndSetSemantics{}) }
  30. Quick Recap - Colors - Button Sizing - Describing Image

    - Describe actions (click, toggles, sliders) - Replace complex gestures with accessibility actions - Merge components
  31. When in doubt: Use system components Use system provided components

    from the operating system instead of creating your own. However, if you have to make your own, do make it accessible as well.
  32. Enable automatic checks in tests Espresso provides a one-line code

    to enable accessibility checks while performing your UI tests. Compose support is currently in developer preview class EspressoTest { init { AccessibilityChecks.enable() } }
  33. Enable automatic checks in tests There were 2 accessibility errors:

    AppCompatImageButton{id=2131165210, ...}: View is missing speakable text needed for a screen reader, AppCompatImageButton{id=2131165210,...}: View falls below the minimum recommended size ... ...
  34. Toolings You can use some of these tools to help

    you in testing accessibility for your software. • Lighthouse (https://chromewebstore.google.com/detail/lighthouse/) • axe DevTools (https://www.deque.com/axe/devtools/) • Android Accessibility Scanner (https://play.google.com/store/apps/details?id=com.google.android.apps.accessibi lity.auditor) • Compose UI Check mode in Android Studio (https://developer.android.com/studio/preview/features/#compose-ui-check)
  35. Test the experience Remember that accessibility is an user experience.

    And like all UXs, you cannot and should not automate everything. Thus, prefer to - Include people with disabilities in your testing groups - Or test yourself! When you go back home today, put a blindfold on, enable Talkback on your phone, and then open your app and see if you can still use it easily
  36. Accessibility is collaborative effort The team needs to shift-left the

    accessibility features. Instead of making it as an afterthought, include accessibility requirements in your feature inception. Everyone (developers, UX engineers, product owners and so on) needs to play their part in making the digital world more inclusive.
  37. Responsible Tech Responsible tech is a way of working that

    aligns technology and business behavior with society’s and individual’s interests. It explores and actively considers the values, unintended consequences and negative impacts of tech, and actively manages, mitigates and reduces risk and harm. Get Thoughtworks Responsible Tech Playbook for free: https://www.thoughtworks.com/en-th/about-us/social-c hange/responsible-tech-playbook
  38. Accessibility: Building an Inclusive Mobile Application Aung Kyaw Paing Senior

    Consultant @ thoughtworks | GDE Android aungkyawpaing.dev