Search in sources :

Example 1 with AccessibilityAction

use of android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction in project robolectric by robolectric.

the class ShadowAccessibilityNodeInfo method removeAction.

@Implementation(minSdk = LOLLIPOP)
public void removeAction(int action) {
    AccessibilityAction convertedAction = getActionFromIdFromFrameWork(action);
    removeAction(convertedAction);
}
Also used : AccessibilityAction(android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction) Implementation(org.robolectric.annotation.Implementation)

Example 2 with AccessibilityAction

use of android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction in project robolectric by robolectric.

the class ShadowAccessibilityNodeInfo method addAction.

@Implementation
public void addAction(int action) {
    if (getApiLevel() >= LOLLIPOP) {
        if ((action & getActionTypeMaskFromFramework()) != 0) {
            throw new IllegalArgumentException("Action is not a combination of the standard " + "actions: " + action);
        }
        int remainingIds = action;
        while (remainingIds > 0) {
            final int id = 1 << Integer.numberOfTrailingZeros(remainingIds);
            remainingIds &= ~id;
            AccessibilityAction convertedAction = getActionFromIdFromFrameWork(id);
            addAction(convertedAction);
        }
    } else {
        actionsMask |= action;
    }
}
Also used : AccessibilityAction(android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction) Implementation(org.robolectric.annotation.Implementation)

Aggregations

AccessibilityAction (android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction)2 Implementation (org.robolectric.annotation.Implementation)2