Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.
Ataul Munim edited this page Mar 18, 2016 · 6 revisions

AccessibilityServices

  • Check if TalkBack (or other spoken feedback accessibility service) is enabled
  • Reports as enabled even if TalkBack is suspended
AccessibilityServices services = AccessibilityServices.newInstance(context);
services.isSpokenFeedbackEnabled();

Custom accessibility actions

  • a wrapper around View actions to facilitate actions via dialog or TalkBack local gestures menu

First create Actions. It's necessary to give each Action a unique resource ID (required by AccessibilityActionCompat see ActionsAccessibilityDelegate), and a display label.

Actions actions = // ...
AccessibilityDelegateCompat delegate = new ActionsAccessibilityDelegate(getResources(), actions);
ViewCompat.setAccessibilityDelegate(this, delegate);

// ...

// if TalkBack is enabled, display dialog on click
private void showAlertDialogFor(Actions actions) {
    new ActionsAlertDialogCreator(getContext(), R.string.tweet_actions_title, actions)
            .create()
            .show();
}
Clone this wiki locally