Java 类android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction 实例源码

项目:yjPlay    文件:DefaultTimeBar.java   
@TargetApi(21)
@Override
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
  super.onInitializeAccessibilityNodeInfo(info);
  info.setClassName(DefaultTimeBar.class.getCanonicalName());
  info.setContentDescription(getProgressText());
  if (duration <= 0) {
    return;
  }
  if (Util.SDK_INT >= 21) {
    info.addAction(AccessibilityAction.ACTION_SCROLL_FORWARD);
    info.addAction(AccessibilityAction.ACTION_SCROLL_BACKWARD);
  } else if (Util.SDK_INT >= 16) {
    info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD);
    info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD);
  }
}
项目:LaunchEnr    文件:LauncherAccessibilityDelegate.java   
public LauncherAccessibilityDelegate(Launcher launcher) {
    mLauncher = launcher;

    mActions.put(REMOVE, new AccessibilityAction(REMOVE,
            launcher.getText(R.string.remove_drop_target_label)));
    mActions.put(INFO, new AccessibilityAction(INFO,
            launcher.getText(R.string.app_info_drop_target_label)));
    mActions.put(UNINSTALL, new AccessibilityAction(UNINSTALL,
            launcher.getText(R.string.uninstall_drop_target_label)));
    mActions.put(ADD_TO_WORKSPACE, new AccessibilityAction(ADD_TO_WORKSPACE,
            launcher.getText(R.string.action_add_to_workspace)));
    mActions.put(MOVE, new AccessibilityAction(MOVE,
            launcher.getText(R.string.action_move)));
    mActions.put(MOVE_TO_WORKSPACE, new AccessibilityAction(MOVE_TO_WORKSPACE,
            launcher.getText(R.string.action_move_to_workspace)));
    mActions.put(RESIZE, new AccessibilityAction(RESIZE,
                    launcher.getText(R.string.action_resize)));
    mActions.put(DEEP_SHORTCUTS, new AccessibilityAction(DEEP_SHORTCUTS,
            launcher.getText(R.string.action_deep_shortcut)));
}
项目:FlickLauncher    文件:LauncherAccessibilityDelegate.java   
public LauncherAccessibilityDelegate(Launcher launcher) {
    mLauncher = launcher;

    mActions.put(REMOVE, new AccessibilityAction(REMOVE,
            launcher.getText(R.string.remove_drop_target_label)));
    mActions.put(INFO, new AccessibilityAction(INFO,
            launcher.getText(R.string.app_info_drop_target_label)));
    mActions.put(UNINSTALL, new AccessibilityAction(UNINSTALL,
            launcher.getText(R.string.uninstall_drop_target_label)));
    mActions.put(ADD_TO_WORKSPACE, new AccessibilityAction(ADD_TO_WORKSPACE,
            launcher.getText(R.string.action_add_to_workspace)));
    mActions.put(MOVE, new AccessibilityAction(MOVE,
            launcher.getText(R.string.action_move)));
    mActions.put(MOVE_TO_WORKSPACE, new AccessibilityAction(MOVE_TO_WORKSPACE,
            launcher.getText(R.string.action_move_to_workspace)));
    mActions.put(RESIZE, new AccessibilityAction(RESIZE,
                    launcher.getText(R.string.action_resize)));
    mActions.put(DEEP_SHORTCUTS, new AccessibilityAction(DEEP_SHORTCUTS,
            launcher.getText(R.string.action_deep_shortcut)));
}
项目:SimpleUILauncher    文件:LauncherAccessibilityDelegate.java   
public LauncherAccessibilityDelegate(Launcher launcher) {
    mLauncher = launcher;

    mActions.put(REMOVE, new AccessibilityAction(REMOVE,
            launcher.getText(R.string.remove_drop_target_label)));
    mActions.put(INFO, new AccessibilityAction(INFO,
            launcher.getText(R.string.app_info_drop_target_label)));
    mActions.put(UNINSTALL, new AccessibilityAction(UNINSTALL,
            launcher.getText(R.string.uninstall_drop_target_label)));
    mActions.put(ADD_TO_WORKSPACE, new AccessibilityAction(ADD_TO_WORKSPACE,
            launcher.getText(R.string.action_add_to_workspace)));
    mActions.put(MOVE, new AccessibilityAction(MOVE,
            launcher.getText(R.string.action_move)));
    mActions.put(MOVE_TO_WORKSPACE, new AccessibilityAction(MOVE_TO_WORKSPACE,
            launcher.getText(R.string.action_move_to_workspace)));
    mActions.put(RESIZE, new AccessibilityAction(RESIZE,
                    launcher.getText(R.string.action_resize)));
    mActions.put(DEEP_SHORTCUTS, new AccessibilityAction(DEEP_SHORTCUTS,
            launcher.getText(R.string.action_deep_shortcut)));
}
项目:SimplOS    文件:LauncherAccessibilityDelegate.java   
public LauncherAccessibilityDelegate(Launcher launcher) {
    mLauncher = launcher;

    mActions.put(REMOVE, new AccessibilityAction(REMOVE,
            launcher.getText(R.string.delete_target_label)));
    mActions.put(INFO, new AccessibilityAction(INFO,
            launcher.getText(R.string.info_target_label)));
    mActions.put(UNINSTALL, new AccessibilityAction(UNINSTALL,
            launcher.getText(R.string.delete_target_uninstall_label)));
    mActions.put(ADD_TO_WORKSPACE, new AccessibilityAction(ADD_TO_WORKSPACE,
            launcher.getText(R.string.action_add_to_workspace)));
    mActions.put(MOVE, new AccessibilityAction(MOVE,
            launcher.getText(R.string.action_move)));
    mActions.put(MOVE_TO_WORKSPACE, new AccessibilityAction(MOVE_TO_WORKSPACE,
            launcher.getText(R.string.action_move_to_workspace)));
    mActions.put(RESIZE, new AccessibilityAction(RESIZE,
                    launcher.getText(R.string.action_resize)));
}
项目:Trebuchet    文件:LauncherAccessibilityDelegate.java   
public LauncherAccessibilityDelegate(Launcher launcher) {
    mLauncher = launcher;

    mActions.put(REMOVE, new AccessibilityAction(REMOVE,
            launcher.getText(R.string.delete_target_label)));
    mActions.put(INFO, new AccessibilityAction(INFO,
            launcher.getText(R.string.info_target_label)));
    mActions.put(UNINSTALL, new AccessibilityAction(UNINSTALL,
            launcher.getText(R.string.delete_target_uninstall_label)));
    mActions.put(ADD_TO_WORKSPACE, new AccessibilityAction(ADD_TO_WORKSPACE,
            launcher.getText(R.string.action_add_to_workspace)));
    mActions.put(MOVE, new AccessibilityAction(MOVE,
            launcher.getText(R.string.action_move)));
    mActions.put(MOVE_TO_WORKSPACE, new AccessibilityAction(MOVE_TO_WORKSPACE,
            launcher.getText(R.string.action_move_to_workspace)));
    mActions.put(RESIZE, new AccessibilityAction(RESIZE,
                    launcher.getText(R.string.action_resize)));
}
项目:stepik-android    文件:DefaultTimeBar.java   
@TargetApi(21)
@Override
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
  super.onInitializeAccessibilityNodeInfo(info);
  info.setClassName(DefaultTimeBar.class.getCanonicalName());
  info.setContentDescription(getProgressText());
  if (duration <= 0) {
    return;
  }
  if (Util.SDK_INT >= 21) {
    info.addAction(AccessibilityAction.ACTION_SCROLL_FORWARD);
    info.addAction(AccessibilityAction.ACTION_SCROLL_BACKWARD);
  } else if (Util.SDK_INT >= 16) {
    info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD);
    info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD);
  }
}
项目:FLauncher    文件:LauncherAccessibilityDelegate.java   
public LauncherAccessibilityDelegate(Launcher launcher) {
    mLauncher = launcher;

    mActions.put(REMOVE, new AccessibilityAction(REMOVE,
            launcher.getText(R.string.delete_target_label)));
    mActions.put(INFO, new AccessibilityAction(INFO,
            launcher.getText(R.string.info_target_label)));
    mActions.put(UNINSTALL, new AccessibilityAction(UNINSTALL,
            launcher.getText(R.string.delete_target_uninstall_label)));
    mActions.put(ADD_TO_WORKSPACE, new AccessibilityAction(ADD_TO_WORKSPACE,
            launcher.getText(R.string.action_add_to_workspace)));
    mActions.put(MOVE, new AccessibilityAction(MOVE,
            launcher.getText(R.string.action_move)));
    mActions.put(MOVE_TO_WORKSPACE, new AccessibilityAction(MOVE_TO_WORKSPACE,
            launcher.getText(R.string.action_move_to_workspace)));
    mActions.put(RESIZE, new AccessibilityAction(RESIZE,
                    launcher.getText(R.string.action_resize)));
}
项目:talkback    文件:TraversalStrategyUtils.java   
/**
 * Returns the scroll action for the given {@link TraversalStrategy.SearchDirection} if the
 * scroll action is available on the current SDK version. Otherwise, returns 0.
 */
public static int convertSearchDirectionToScrollAction(
        @TraversalStrategy.SearchDirection int direction) {
    boolean supportsDirectional = Build.VERSION.SDK_INT >= Build.VERSION_CODES.M;

    if (direction == TraversalStrategy.SEARCH_FOCUS_FORWARD) {
        return AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD;
    } else if (direction == TraversalStrategy.SEARCH_FOCUS_BACKWARD) {
        return AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD;
    } else if (supportsDirectional) {
        if (direction == TraversalStrategy.SEARCH_FOCUS_LEFT) {
            return AccessibilityAction.ACTION_SCROLL_LEFT.getId();
        } else if (direction == TraversalStrategy.SEARCH_FOCUS_RIGHT) {
            return AccessibilityAction.ACTION_SCROLL_RIGHT.getId();
        } else if (direction == TraversalStrategy.SEARCH_FOCUS_UP) {
            return AccessibilityAction.ACTION_SCROLL_UP.getId();
        } else if (direction == TraversalStrategy.SEARCH_FOCUS_DOWN) {
            return AccessibilityAction.ACTION_SCROLL_DOWN.getId();
        }
    }

    return 0;
}
项目:talkback    文件:TraversalStrategyUtils.java   
/**
 * Returns the {@link TraversalStrategy.SearchDirectionOrUnknown} for the given scroll
 * action; {@link TraversalStrategy#SEARCH_FOCUS_UNKNOWN} is returned for a scroll action
 * that can't be handled (e.g. because the current API level doesn't support it).
 */
public static @TraversalStrategy.SearchDirectionOrUnknown int
        convertScrollActionToSearchDirection(int scrollAction) {
    boolean supportsDirectional = Build.VERSION.SDK_INT >= Build.VERSION_CODES.M;

    if (scrollAction == AccessibilityNodeInfo.ACTION_SCROLL_FORWARD) {
        return TraversalStrategy.SEARCH_FOCUS_FORWARD;
    } else if (scrollAction == AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD) {
        return TraversalStrategy.SEARCH_FOCUS_BACKWARD;
    } else if (supportsDirectional) {
        if (scrollAction == AccessibilityAction.ACTION_SCROLL_LEFT.getId()) {
            return TraversalStrategy.SEARCH_FOCUS_LEFT;
        } else if (scrollAction == AccessibilityAction.ACTION_SCROLL_RIGHT.getId()) {
            return TraversalStrategy.SEARCH_FOCUS_RIGHT;
        } else if (scrollAction == AccessibilityAction.ACTION_SCROLL_UP.getId()) {
            return TraversalStrategy.SEARCH_FOCUS_UP;
        } else if (scrollAction == AccessibilityAction.ACTION_SCROLL_DOWN.getId()) {
            return TraversalStrategy.SEARCH_FOCUS_DOWN;
        }
    }

    return TraversalStrategy.SEARCH_FOCUS_UNKNOWN;
}
项目:talkback    文件:ShadowAccessibilityNodeInfo.java   
@Override
@Implementation
public boolean equals(Object other) {
    if (other == null) {
        return false;
    }

    if (other == this) {
        return true;
    }

    if (other.getClass() != AccessibilityAction.class) {
        return false;
    }

    return id == ((AccessibilityAction) other).getId();
}
项目:transistor    文件:DefaultTimeBar.java   
@TargetApi(21)
@Override
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
  super.onInitializeAccessibilityNodeInfo(info);
  info.setClassName(DefaultTimeBar.class.getCanonicalName());
  info.setContentDescription(getProgressText());
  if (duration <= 0) {
    return;
  }
  if (Util.SDK_INT >= 21) {
    info.addAction(AccessibilityAction.ACTION_SCROLL_FORWARD);
    info.addAction(AccessibilityAction.ACTION_SCROLL_BACKWARD);
  } else if (Util.SDK_INT >= 16) {
    info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD);
    info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD);
  }
}
项目:LaunchEnr    文件:OverviewScreenAccessibilityDelegate.java   
public OverviewScreenAccessibilityDelegate(Workspace workspace) {
    mWorkspace = workspace;

    Context context = mWorkspace.getContext();
    boolean isRtl = Utilities.isRtl(context.getResources());
    mActions.put(MOVE_BACKWARD, new AccessibilityAction(MOVE_BACKWARD,
            context.getText(isRtl ? R.string.action_move_screen_right :
                R.string.action_move_screen_left)));
    mActions.put(MOVE_FORWARD, new AccessibilityAction(MOVE_FORWARD,
            context.getText(isRtl ? R.string.action_move_screen_left :
                R.string.action_move_screen_right)));
}
项目:LaunchEnr    文件:OverviewAccessibilityDelegate.java   
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfo info) {
    super.onInitializeAccessibilityNodeInfo(host, info);

    Context context = host.getContext();
    info.addAction(new AccessibilityAction(OVERVIEW, context.getText(OVERVIEW)));

    if (Utilities.isWallpaperAllowed(context)) {
        info.addAction(new AccessibilityAction(WALLPAPERS, context.getText(WALLPAPERS)));
    }
    info.addAction(new AccessibilityAction(WIDGETS, context.getText(WIDGETS)));
    info.addAction(new AccessibilityAction(SETTINGS, context.getText(SETTINGS)));
}
项目:LaunchEnr    文件:CustomActionsPopup.java   
private List<AccessibilityAction> getActionList() {
    if (mIcon == null || !(mIcon.getTag() instanceof ItemInfo)) {
        return Collections.EMPTY_LIST;
    }

    AccessibilityNodeInfo info = AccessibilityNodeInfo.obtain();
    mDelegate.addSupportedActions(mIcon, info, true);
    List<AccessibilityAction> result = new ArrayList<>(info.getActionList());
    info.recycle();
    return result;
}
项目:LaunchEnr    文件:CustomActionsPopup.java   
public boolean show() {
    List<AccessibilityAction> actions = getActionList();
    if (actions.isEmpty()) {
        return false;
    }

    PopupMenu popup = new PopupMenu(mLauncher, mIcon);
    popup.setOnMenuItemClickListener(this);
    Menu menu = popup.getMenu();
    for (AccessibilityAction action : actions) {
        menu.add(Menu.NONE, action.getId(), Menu.NONE, action.getLabel());
    }
    popup.show();
    return true;
}
项目:boohee_v5.6    文件:RadialPickerLayout.java   
public void onInitializeAccessibilityNodeInfo(@NonNull AccessibilityNodeInfo info) {
    super.onInitializeAccessibilityNodeInfo(info);
    if (VERSION.SDK_INT >= 21) {
        info.addAction(AccessibilityAction.ACTION_SCROLL_BACKWARD);
        info.addAction(AccessibilityAction.ACTION_SCROLL_FORWARD);
        return;
    }
    info.addAction(4096);
    info.addAction(8192);
}
项目:boohee_v5.6    文件:DayPickerView.java   
public void onInitializeAccessibilityNodeInfo(@NonNull AccessibilityNodeInfo info) {
    super.onInitializeAccessibilityNodeInfo(info);
    if (VERSION.SDK_INT >= 21) {
        info.addAction(AccessibilityAction.ACTION_SCROLL_BACKWARD);
        info.addAction(AccessibilityAction.ACTION_SCROLL_FORWARD);
        return;
    }
    info.addAction(4096);
    info.addAction(8192);
}
项目:FlickLauncher    文件:OverviewScreenAccessibilityDelegate.java   
public OverviewScreenAccessibilityDelegate(Workspace workspace) {
    mWorkspace = workspace;

    Context context = mWorkspace.getContext();
    boolean isRtl = Utilities.isRtl(context.getResources());
    mActions.put(MOVE_BACKWARD, new AccessibilityAction(MOVE_BACKWARD,
            context.getText(isRtl ? R.string.action_move_screen_right :
                R.string.action_move_screen_left)));
    mActions.put(MOVE_FORWARD, new AccessibilityAction(MOVE_FORWARD,
            context.getText(isRtl ? R.string.action_move_screen_left :
                R.string.action_move_screen_right)));
}
项目:FlickLauncher    文件:OverviewAccessibilityDelegate.java   
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfo info) {
    super.onInitializeAccessibilityNodeInfo(host, info);

    Context context = host.getContext();
    info.addAction(new AccessibilityAction(OVERVIEW, context.getText(OVERVIEW)));

    if (Utilities.isWallapaperAllowed(context)) {
        info.addAction(new AccessibilityAction(WALLPAPERS, context.getText(WALLPAPERS)));
    }
    info.addAction(new AccessibilityAction(WIDGETS, context.getText(WIDGETS)));
    info.addAction(new AccessibilityAction(SETTINGS, context.getText(SETTINGS)));
}
项目:SimpleUILauncher    文件:OverviewScreenAccessibilityDelegate.java   
public OverviewScreenAccessibilityDelegate(Workspace workspace) {
    mWorkspace = workspace;

    Context context = mWorkspace.getContext();
    boolean isRtl = Utilities.isRtl(context.getResources());
    mActions.put(MOVE_BACKWARD, new AccessibilityAction(MOVE_BACKWARD,
            context.getText(isRtl ? R.string.action_move_screen_right :
                R.string.action_move_screen_left)));
    mActions.put(MOVE_FORWARD, new AccessibilityAction(MOVE_FORWARD,
            context.getText(isRtl ? R.string.action_move_screen_left :
                R.string.action_move_screen_right)));
}
项目:SimpleUILauncher    文件:OverviewAccessibilityDelegate.java   
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfo info) {
    super.onInitializeAccessibilityNodeInfo(host, info);

    Context context = host.getContext();
    info.addAction(new AccessibilityAction(OVERVIEW, context.getText(OVERVIEW)));

    if (Utilities.isWallapaperAllowed(context)) {
        info.addAction(new AccessibilityAction(WALLPAPERS, context.getText(WALLPAPERS)));
    }
    info.addAction(new AccessibilityAction(WIDGETS, context.getText(WIDGETS)));
    info.addAction(new AccessibilityAction(SETTINGS, context.getText(SETTINGS)));
}
项目:SimplOS    文件:OverviewScreenAccessibilityDelegate.java   
public OverviewScreenAccessibilityDelegate(Workspace workspace) {
    mWorkspace = workspace;

    Context context = mWorkspace.getContext();
    boolean isRtl = Utilities.isRtl(context.getResources());
    mActions.put(MOVE_BACKWARD, new AccessibilityAction(MOVE_BACKWARD,
            context.getText(isRtl ? R.string.action_move_screen_right :
                R.string.action_move_screen_left)));
    mActions.put(MOVE_FORWARD, new AccessibilityAction(MOVE_FORWARD,
            context.getText(isRtl ? R.string.action_move_screen_left :
                R.string.action_move_screen_right)));
}
项目:Trebuchet    文件:OverviewScreenAccessibilityDelegate.java   
public OverviewScreenAccessibilityDelegate(Workspace workspace) {
    mWorkspace = workspace;

    Context context = mWorkspace.getContext();
    boolean isRtl = Utilities.isRtl(context.getResources());
    mActions.put(MOVE_BACKWARD, new AccessibilityAction(MOVE_BACKWARD,
            context.getText(isRtl ? R.string.action_move_screen_right :
                R.string.action_move_screen_left)));
    mActions.put(MOVE_FORWARD, new AccessibilityAction(MOVE_FORWARD,
            context.getText(isRtl ? R.string.action_move_screen_left :
                R.string.action_move_screen_right)));
}
项目:appium-uiautomator2-server    文件:AccessibilityNodeInfoHelper.java   
/**
 * Perform accessibility action ACTION_SET_PROGRESS on the node
 *
 * @param value desired progress value
 * @return true if action performed successfully
 */
public static boolean setProgressValue(final AccessibilityNodeInfo node, final float value) {
    if (!node.getActionList().contains(AccessibilityAction.ACTION_SET_PROGRESS)) {
        Logger.debug("The element does not support ACTION_SET_PROGRESS action.");
        return false;
    }
    Logger.debug(String.format(
            "Trying to perform ACTION_SET_PROGRESS accessibility action with value %s", value));
    final Bundle args = new Bundle();
    args.putFloat(AccessibilityNodeInfo.ACTION_ARGUMENT_PROGRESS_VALUE, value);
    return node.performAction(AccessibilityAction.ACTION_SET_PROGRESS.getId(), args);
}
项目:FMTech    文件:EditRelatedLinkListItem.java   
public final void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo paramAccessibilityNodeInfo)
{
  super.onInitializeAccessibilityNodeInfo(paramAccessibilityNodeInfo);
  if (Build.VERSION.SDK_INT >= 21)
  {
    la localla = g();
    for (int i = 0; i < localla.size(); i++) {
      paramAccessibilityNodeInfo.addAction(new AccessibilityNodeInfo.AccessibilityAction(((Integer)localla.b[(i << 1)]).intValue(), (CharSequence)localla.b[(1 + (i << 1))]));
    }
  }
}
项目:FMTech    文件:EditCategoryListItem.java   
public final void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo paramAccessibilityNodeInfo)
{
  super.onInitializeAccessibilityNodeInfo(paramAccessibilityNodeInfo);
  if (Build.VERSION.SDK_INT >= 21)
  {
    la localla = g();
    for (int i = 0; i < localla.size(); i++) {
      paramAccessibilityNodeInfo.addAction(new AccessibilityNodeInfo.AccessibilityAction(((Integer)localla.b[(i << 1)]).intValue(), (CharSequence)localla.b[(1 + (i << 1))]));
    }
  }
}
项目:FMTech    文件:eab.java   
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo paramAccessibilityNodeInfo)
{
  super.onInitializeAccessibilityNodeInfo(paramAccessibilityNodeInfo);
  if ((this.R != 0) || (Build.VERSION.SDK_INT < 21)) {}
  for (;;)
  {
    return;
    la localla = g();
    for (int i1 = 0; i1 < localla.size(); i1++) {
      paramAccessibilityNodeInfo.addAction(new AccessibilityNodeInfo.AccessibilityAction(((Integer)localla.b[(i1 << 1)]).intValue(), (CharSequence)localla.b[(1 + (i1 << 1))]));
    }
  }
}
项目:FLauncher    文件:OverviewScreenAccessibilityDelegate.java   
public OverviewScreenAccessibilityDelegate(Workspace workspace) {
    mWorkspace = workspace;

    Context context = mWorkspace.getContext();
    boolean isRtl = Utilities.isRtl(context.getResources());
    mActions.put(MOVE_BACKWARD, new AccessibilityAction(MOVE_BACKWARD,
            context.getText(isRtl ? R.string.action_move_screen_right :
                R.string.action_move_screen_left)));
    mActions.put(MOVE_FORWARD, new AccessibilityAction(MOVE_FORWARD,
            context.getText(isRtl ? R.string.action_move_screen_left :
                R.string.action_move_screen_right)));
}
项目:talkback    文件:RuleSeekBar.java   
@Override
public boolean accept(TalkBackService service, AccessibilityNodeInfoCompat node) {
    if (!BuildCompat.isAtLeastN()) {
        return false;
    }

    return AccessibilityNodeInfoUtils.supportsAction(node,
            AccessibilityNodeInfo.AccessibilityAction.ACTION_SET_PROGRESS.getId());
}
项目:talkback    文件:RuleSeekBar.java   
static void setProgress(AccessibilityNodeInfoCompat node, int progress) {
    RangeInfoCompat rangeInfo = node.getRangeInfo();
    if (rangeInfo != null && progress >= 0 && progress <= 100) {
        Bundle args = new Bundle();
        args.putFloat(AccessibilityNodeInfo.ACTION_ARGUMENT_PROGRESS_VALUE,
                percentToReal(progress, rangeInfo.getMin(),
                        rangeInfo.getMax()));
        PerformActionUtils.performAction(node,
                AccessibilityAction.ACTION_SET_PROGRESS.getId(),
                args);
    }
}
项目:talkback    文件:RuleCustomActionTest.java   
@Override
public void onInitializeAccessibilityNodeInfo(View host,
        AccessibilityNodeInfo info) {
    super.onInitializeAccessibilityNodeInfo(host, info);
    info.addAction(new AccessibilityAction(R.id.custom_action_1, "CA1"));
    info.addAction(new AccessibilityAction(R.id.custom_action_2, "CA2"));
}
项目:talkback    文件:RuleCustomActionTest.java   
@Override
public void onInitializeAccessibilityNodeInfo(View host,
                                              AccessibilityNodeInfo info) {
    super.onInitializeAccessibilityNodeInfo(host, info);
    info.addAction(new AccessibilityAction(R.id.custom_action_3, "CA3"));
    info.addAction(new AccessibilityAction(R.id.custom_action_4, "CA4"));
}
项目:talkback    文件:ShadowAccessibilityNodeInfo.java   
@Implementation
public void addAction(int action) {
        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);
    }
}
项目:talkback    文件:ShadowAccessibilityNodeInfo.java   
@Implementation
public void addAction(AccessibilityAction action) {
    if (action == null) {
        return;
    }

    if (actionsArray == null) {
        actionsArray = new ArrayList<>();
    }
    actionsArray.remove(action);
    actionsArray.add(action);
}
项目:talkback    文件:ShadowAccessibilityNodeInfo.java   
@Implementation
public boolean removeAction(AccessibilityAction action) {
    if (action == null || actionsArray == null) {
        return false;
    }
    return actionsArray.remove(action);
}
项目:talkback    文件:ShadowAccessibilityNodeInfo.java   
@Implementation
public List<AccessibilityAction> getActionList() {
    if (actionsArray == null) {
        return Collections.emptyList();
    }

    return actionsArray;
}
项目:LaunchEnr    文件:ShortcutMenuAccessibilityDelegate.java   
public ShortcutMenuAccessibilityDelegate(Launcher launcher) {
    super(launcher);
    mActions.put(DISMISS_NOTIFICATION, new AccessibilityAction(DISMISS_NOTIFICATION,
            launcher.getText(R.string.action_dismiss_notification)));
}
项目:boohee_v5.6    文件:AccessibilityNodeInfoCompatApi21.java   
static void addAction(Object info, Object action) {
    ((AccessibilityNodeInfo) info).addAction((AccessibilityAction) action);
}
项目:boohee_v5.6    文件:AccessibilityNodeInfoCompatApi21.java   
public static boolean removeAction(Object info, Object action) {
    return ((AccessibilityNodeInfo) info).removeAction((AccessibilityAction) action);
}