Example usage for android.view.accessibility AccessibilityNodeInfo addAction

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

Introduction

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

Prototype

@Deprecated
public void addAction(int action) 

Source Link

Document

Adds an action that can be performed on the node.

Usage

From source file:com.android.utils.traversal.OrderedTraversalControllerTest.java

@MediumTest
public void testWebDescendantsExcludedWhenNotRequested() {
    View view2 = getActivity().findViewById(R.id.node2);
    view2.setAccessibilityDelegate(new View.AccessibilityDelegate() {
        @Override/* w  w w .ja  v  a 2  s.  c o  m*/
        public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfo info) {
            super.onInitializeAccessibilityNodeInfo(host, info);
            info.addAction(AccessibilityNodeInfo.ACTION_NEXT_HTML_ELEMENT);
        }
    });

    initController(false);
    assertForwardOrder(mNode1, mNode2, mNode5, mNode6, mNode7);
    assertBackwardOrder(mNode7, mNode6, mNode5, mNode2, mNode1);
}

From source file:com.android.utils.traversal.OrderedTraversalControllerTest.java

@MediumTest
public void testWebDescendantsIncludedWhenRequested() {
    View view2 = getActivity().findViewById(R.id.node2);
    view2.setAccessibilityDelegate(new View.AccessibilityDelegate() {
        @Override//from   w ww.  j  a  va  2 s .  com
        public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfo info) {
            super.onInitializeAccessibilityNodeInfo(host, info);
            info.addAction(AccessibilityNodeInfo.ACTION_NEXT_HTML_ELEMENT);
        }
    });

    initController(true);
    assertForwardOrder(mNode1, mNode2, mNode3, mNode4, mNode5, mNode6, mNode7);
    assertBackwardOrder(mNode7, mNode6, mNode5, mNode4, mNode3, mNode2, mNode1);
}

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);// ww w  . j a  v  a  2 s.  c  om
}

From source file:com.codetroopers.betterpickers.radialtimepicker.RadialPickerLayout.java

/**
 * Necessary for accessibility, to ensure we support "scrolling" forward and backward in the circle.
 */// ww w .  jav  a2  s .  co  m
@Override
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
    super.onInitializeAccessibilityNodeInfo(info);
    info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD);
    info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD);
}

From source file:com.android.yijiang.kzx.widget.betterpickers.radialtimepicker.RadialPickerLayout.java

/**
 * Necessary for accessibility, to ensure we support "scrolling" forward and backward in the circle.
 *//*  ww w  .j a v a2s .c  om*/
@SuppressLint("NewApi")
@Override
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
    super.onInitializeAccessibilityNodeInfo(info);
    info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD);
    info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD);
}

From source file:org.holoeverywhere.widget.datetimepicker.time.RadialPickerLayout.java

/**
 * Necessary for accessibility, to ensure we support "scrolling" forward and backward
 * in the circle.// ww  w.  j  ava 2s .  c  om
 */
@Override
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
    super.onInitializeAccessibilityNodeInfo(info);
    info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD);
    info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD);
}

From source file:com.a.mirko.android.datetimepicker.time.RadialPickerLayout.java

/**
 * Necessary for accessibility, to ensure we support "scrolling" forward and backward
 * in the circle.//  w  w w.j a  va 2 s . c  o  m
 */
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
    if (Build.VERSION.SDK_INT >= 14) {
        super.onInitializeAccessibilityNodeInfo(info);
        info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD);
        info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD);
    }
}

From source file:com.tasomaniac.openwith.resolver.ResolverDrawerLayout.java

@SuppressWarnings("deprecation")
@SuppressLint("InlinedApi")
@Override//  w  ww .  j a  v  a  2 s. c  o m
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
    super.onInitializeAccessibilityNodeInfo(info);
    info.setClassName(ResolverDrawerLayout.class.getName());
    if (isEnabled()) {
        if (mCollapseOffset != 0) {
            info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD);
            info.setScrollable(true);
        }
    }
}

From source file:com.borax12.materialdaterangepicker.single.time.RadialPickerLayout.java

/**
 * Necessary for accessibility, to ensure we support "scrolling" forward and backward
 * in the circle./*from w w w  .  j a  va2  s .  c om*/
 */
@Override
@SuppressWarnings("deprecation")
public void onInitializeAccessibilityNodeInfo(@NonNull AccessibilityNodeInfo info) {
    super.onInitializeAccessibilityNodeInfo(info);
    if (Build.VERSION.SDK_INT >= 21) {
        info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_BACKWARD);
        info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_FORWARD);
    } else {
        info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD);
        info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD);
    }
}

From source file:com.customdatepicker.time.RadialPickerLayout.java

/**
 * Necessary for accessibility, to ensure we support "scrolling" forward and backward
 * in the circle./*from  w w  w.  ja va 2 s .c o m*/
 */
@Override
@SuppressWarnings("deprecation")
public void onInitializeAccessibilityNodeInfo(@NonNull AccessibilityNodeInfo info) {
    super.onInitializeAccessibilityNodeInfo(info);
    if (Build.VERSION.SDK_INT >= 21) {
        info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_BACKWARD);
        info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_FORWARD);
    } else if (Build.VERSION.SDK_INT >= 16) {
        info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD);
        info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD);
    } else {
        info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
        info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
    }
}