Android provides great accessibility support, but finding that information can sometimes be difficult to impossible. This presentation gathers some hard to find information on Android Accessibility and gives additional links to resources for making your application accessible.
Please visit the accessible version of this presentation for slide details: http://www.last-child.com/android-a11y-missing-manual/
4. AccessibilityChecks
• AccessibilityChecks released at Google
IO 2015
• Open Source tests for Espresso and
Robolectric
• Soon: Android app that lets you test on a
device
• Goal: Adopt AccessibilityChecks for
Appium
11. accessibilityLiveRegion
• Based on the Live Region experience in HTML +
ARIA
• Content is announced when it changes or
appears on screen
• android:accessibilityLiveRegion =“polite”
13. AccessibilityAction
• Swipes and other hard to discover actions
• Actions are activated from the Local Context
Menu
• Provide hints for actions
14. Create AccessibilityAction
/**
* @param actionId The id for this action. This should either be one of
* the standard actions or a specific action for your app. In that case it
* is required to use a resource identifier.
*/
public AccessibilityAction(int id, CharSequence label)
new AccessibilityAction(R.id.dismiss, getString(R.string.dismiss));
new AccessibilityAction(ACTION_CLICK,
getString(R.string.play_song)); !
// Constants for all the standard actions with default label:
AccessibilityAction.ACTION_CLICK
15. Handling a Custom Action
eventView.setAccessibilityDelegate(new AccessibilityDelegate {
@Override
public onInitializeAccessibilityNodeInfo(View host,
AccessibilityNodeInfo info) {
super.onInitializeAccessibilityNodeInfo(host, info);
info.addAction(new AccessibilityAction(R.id.dismiss,
}
@Override
getString(R.string.dismiss)));
public boolean performAccessibilityAction(View host, int action,
Bundle args) {
if (action == R.id.dismiss) {} // Logic for action
}
});
23. android:hint
• This create a placeholder text string within an
input
• This was the preferred method and is a hack
• The hint is removed when a user adds a value to
the input
• Still a valid method of adding a label to an input