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

Accessibility on Android

Applidium
November 27, 2015

Accessibility on Android

Talk for Paris Android User Group on October 2015

Applidium

November 27, 2015
Tweet

More Decks by Applidium

Other Decks in Technology

Transcript

  1. Every app that provides a service Transportation APPS THAT SHOULD

    BE ACCESSIBLE Messaging, Email, Social Banking, Financial E-commerce
  2. Low vision • Use ‘sp’ for your text size •

    Make your layout adapt if the text is bigger (also needed for i18n) • Test your app
  3. • Activates TalkBack when moving a finger around the screen

    • Double tap to validate selection • Two fingers for scrolling EXPLORE
  4. Detect if accessibility services are enabled // For example: keep

    media controls visible if they are enabled AccessibilityManager am = (AccessibilityManager) context.getSystemService(ACCESSIBILITY_SERVICE); boolean isAccessibilityEnabled = am.isEnabled(); // TalkBack boolean isExploreByTouchEnabled = am.isTouchExplorationEnabled(); // Explore by touch
  5. labelFor: links an EditText to its label <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content"

    android:orientation="vertical"> <TextView android:layout_width="match_parent" android:layout_height="match_parent" android:labelFor="@+id/edit_item_name" android:text="Item Name"/> <EditText android:id="@+id/edit_item_name" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="Item Name"/> </LinearLayout>
  6. labelFor: links an EditText to its label <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content"

    android:orientation="vertical"> <TextView android:layout_width="match_parent" android:layout_height="match_parent" android:labelFor="@+id/edit_item_name" android:text="Item Name"/> <EditText android:id="@+id/edit_item_name" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="Item Name"/> </LinearLayout>
  7. accessibilityLiveRegion: will be read when content is modified <TextView android:id="@+id/search_result"

    android:layout_width="match_parent" android:layout_height="match_parent" android:accessibilityLiveRegion="polite"/>
  8. accessibilityLiveRegion: will be read when content is modified <TextView android:id="@+id/search_result"

    android:layout_width="match_parent" android:layout_height="match_parent" android:accessibilityLiveRegion="polite"/>
  9. Testing frameworks // Espresso @Before public void setUp() { AccessibilityChecks.enable();

    } // Robolectric @org.robolectric.annotation.AccessibilityChecks @Test public void clickingLogin_shouldStartLoginActivity() {}
  10. • Provide content descriptions for: Buttons, ImageViews, ImageButtons, CheckBoxes, …

    • Do not put “button” or “image” in your content descriptions • Use labelFor on your EditTexts • Use Lint and Accessibility Checks • Test your app ! Developing for the blind
  11. Illustrations: Anne-Audrey Gounot Color blind palette: http://mkweb.bcgsc.ca/biovis2012/ Dots: https://dribbble.com/shots/1599809-Color-Blind-Mode Trello:

    http://littlebigdetails.com/post/35775193711/trello-color-blind-friendly-mode-makes Color blind graphs: wearecolorblind.com Blind app user: Tommy Edison: https://www.youtube.com/watch?v=0i1k3srHKAA RESOURCES