Example usage for android.view.accessibility AccessibilityNodeInfo MOVEMENT_GRANULARITY_PARAGRAPH

List of usage examples for android.view.accessibility AccessibilityNodeInfo MOVEMENT_GRANULARITY_PARAGRAPH

Introduction

In this page you can find the example usage for android.view.accessibility AccessibilityNodeInfo MOVEMENT_GRANULARITY_PARAGRAPH.

Prototype

int MOVEMENT_GRANULARITY_PARAGRAPH

To view the source code for android.view.accessibility AccessibilityNodeInfo MOVEMENT_GRANULARITY_PARAGRAPH.

Click Source Link

Document

Movement granularity bit for traversing the text of a node by paragraph.

Usage

From source file:org.chromium.content.browser.accessibility.JellyBeanAccessibilityInjector.java

@Override
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
    info.setMovementGranularities(AccessibilityNodeInfo.MOVEMENT_GRANULARITY_CHARACTER
            | AccessibilityNodeInfo.MOVEMENT_GRANULARITY_WORD | AccessibilityNodeInfo.MOVEMENT_GRANULARITY_LINE
            | AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PARAGRAPH
            | AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE);
    info.addAction(AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY);
    info.addAction(AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY);
    info.addAction(AccessibilityNodeInfo.ACTION_NEXT_HTML_ELEMENT);
    info.addAction(AccessibilityNodeInfo.ACTION_PREVIOUS_HTML_ELEMENT);
    info.addAction(AccessibilityNodeInfo.ACTION_CLICK);
    info.setClickable(true);//from w w  w  .  ja  va 2s .c  om
}

From source file:android.webkit.AccessibilityInjector.java

/**
 * Initializes an {@link AccessibilityNodeInfo} with the actions and
 * movement granularity levels supported by this
 * {@link AccessibilityInjector}.//from ww  w.j  av  a2  s . c  o m
 * <p>
 * If an action identifier is added in this method, this
 * {@link AccessibilityInjector} should also return {@code true} from
 * {@link #supportsAccessibilityAction(int)}.
 * </p>
 *
 * @param info The info to initialize.
 * @see View#onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo)
 */
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
    info.setMovementGranularities(AccessibilityNodeInfo.MOVEMENT_GRANULARITY_CHARACTER
            | AccessibilityNodeInfo.MOVEMENT_GRANULARITY_WORD | AccessibilityNodeInfo.MOVEMENT_GRANULARITY_LINE
            | AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PARAGRAPH
            | AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE);
    info.addAction(AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY);
    info.addAction(AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY);
    info.addAction(AccessibilityNodeInfo.ACTION_NEXT_HTML_ELEMENT);
    info.addAction(AccessibilityNodeInfo.ACTION_PREVIOUS_HTML_ELEMENT);
    info.addAction(AccessibilityNodeInfo.ACTION_CLICK);
    info.setClickable(true);
}