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);
}
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;
}
}
Aggregations