本文整理汇总了Java中android.view.accessibility.AccessibilityNodeInfo.addAction方法的典型用法代码示例。如果您正苦于以下问题:Java AccessibilityNodeInfo.addAction方法的具体用法?Java AccessibilityNodeInfo.addAction怎么用?Java AccessibilityNodeInfo.addAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.accessibility.AccessibilityNodeInfo
的用法示例。
在下文中一共展示了AccessibilityNodeInfo.addAction方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onInitializeAccessibilityNodeInfo
import android.view.accessibility.AccessibilityNodeInfo; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
@SuppressLint("Override")
@Override
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
super.onInitializeAccessibilityNodeInfo(info);
info.setClassName(AbsHListView.class.getName());
if (isEnabled()) {
if (getFirstVisiblePosition() > 0) {
info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
}
if (getLastVisiblePosition() < getCount() - 1) {
info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
}
}
}
示例2: onInitializeAccessibilityNodeInfo
import android.view.accessibility.AccessibilityNodeInfo; //导入方法依赖的package包/类
@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);
}
}
示例3: onInitializeAccessibilityNodeInfo
import android.view.accessibility.AccessibilityNodeInfo; //导入方法依赖的package包/类
@TargetApi(21)
@Override
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
super.onInitializeAccessibilityNodeInfo(info);
info.setClassName(com.google.android.exoplayer2.ui.DefaultTimeBar.class.getCanonicalName());
info.setContentDescription(getProgressText());
if (duration <= 0) {
return;
}
if (Util.SDK_INT >= 21) {
info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_FORWARD);
info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_BACKWARD);
} else if (Util.SDK_INT >= 16) {
info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD);
info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD);
}
}
示例4: onInitializeAccessibilityNodeInfo
import android.view.accessibility.AccessibilityNodeInfo; //导入方法依赖的package包/类
/**
* Necessary for accessibility, to ensure we support "scrolling" forward and backward
* in the circle.
*/
@Override
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
super.onInitializeAccessibilityNodeInfo(info);
info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD);
info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD);
}
示例5: onInitializeAccessibilityNodeInfo
import android.view.accessibility.AccessibilityNodeInfo; //导入方法依赖的package包/类
/**
* Necessary for accessibility, to ensure we support "scrolling" forward and backward
* in the circle.
*/
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);
}
}
示例6: onInitializeAccessibilityNodeInfo
import android.view.accessibility.AccessibilityNodeInfo; //导入方法依赖的package包/类
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfo info) {
super.onInitializeAccessibilityNodeInfo(host, info);
int index = mWorkspace.indexOfChild(host);
if (index < mWorkspace.getChildCount() - 1) {
info.addAction(mActions.get(MOVE_FORWARD));
}
int startIndex = mWorkspace.numCustomPages();
if (index > startIndex) {
info.addAction(mActions.get(MOVE_BACKWARD));
}
}
示例7: onInitializeAccessibilityNodeInfo
import android.view.accessibility.AccessibilityNodeInfo; //导入方法依赖的package包/类
@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)));
}
示例8: addSupportedActions
import android.view.accessibility.AccessibilityNodeInfo; //导入方法依赖的package包/类
@Override
public void addSupportedActions(View host, AccessibilityNodeInfo info, boolean fromKeyboard) {
if ((host.getParent() instanceof DeepShortcutView)) {
info.addAction(mActions.get(ADD_TO_WORKSPACE));
} else if (host instanceof NotificationMainView) {
NotificationMainView notificationView = (NotificationMainView) host;
if (notificationView.canChildBeDismissed(notificationView)) {
info.addAction(mActions.get(DISMISS_NOTIFICATION));
}
}
}
示例9: addSupportedActions
import android.view.accessibility.AccessibilityNodeInfo; //导入方法依赖的package包/类
public void addSupportedActions(View host, AccessibilityNodeInfo info, boolean fromKeyboard) {
if (!(host.getTag() instanceof ItemInfo)) return;
ItemInfo item = (ItemInfo) host.getTag();
// If the request came from keyboard, do not add custom shortcuts as that is already
// exposed as a direct shortcut
if (!fromKeyboard && DeepShortcutManager.supportsShortcuts(item)) {
info.addAction(mActions.get(DEEP_SHORTCUTS));
}
if (DeleteDropTarget.supportsAccessibleDrop(item)) {
info.addAction(mActions.get(REMOVE));
}
if (UninstallDropTarget.supportsDrop(host.getContext(), item)) {
info.addAction(mActions.get(UNINSTALL));
}
// Do not add move actions for keyboard request as this uses virtual nodes.
if (!fromKeyboard && ((item instanceof ShortcutInfo)
|| (item instanceof LauncherAppWidgetInfo)
|| (item instanceof FolderInfo))) {
info.addAction(mActions.get(MOVE));
if (item.container >= 0) {
info.addAction(mActions.get(MOVE_TO_WORKSPACE));
} else if (item instanceof LauncherAppWidgetInfo) {
if (!getSupportedResizeActions(host, (LauncherAppWidgetInfo) item).isEmpty()) {
info.addAction(mActions.get(RESIZE));
}
}
}
if ((item instanceof AppInfo) || (item instanceof PendingAddItemInfo)) {
info.addAction(mActions.get(ADD_TO_WORKSPACE));
}
}
示例10: onInitializeAccessibilityNodeInfo
import android.view.accessibility.AccessibilityNodeInfo; //导入方法依赖的package包/类
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfo info) {
super.onInitializeAccessibilityNodeInfo(host, info);
int index = mWorkspace.indexOfChild(host);
if (index < mWorkspace.getChildCount() - 1) {
info.addAction(mActions.get(MOVE_FORWARD));
}
int startIndex = mWorkspace.numCustomPages() + (FeatureFlags.QSB_ON_FIRST_SCREEN ? 1 : 0);
if (index > startIndex) {
info.addAction(mActions.get(MOVE_BACKWARD));
}
}
示例11: onInitializeAccessibilityNodeInfo
import android.view.accessibility.AccessibilityNodeInfo; //导入方法依赖的package包/类
/**
* Necessary for accessibility, to ensure we support "scrolling" forward and backward
* in the circle.
*/
@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);
}
}
示例12: onInitializeAccessibilityNodeInfo
import android.view.accessibility.AccessibilityNodeInfo; //导入方法依赖的package包/类
/**
* Necessary for accessibility, to ensure we support "scrolling" forward and backward
* in the month list.
*/
@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);
}
}
示例13: createAccessibiltyNodeInfoForInputText
import android.view.accessibility.AccessibilityNodeInfo; //导入方法依赖的package包/类
private AccessibilityNodeInfo createAccessibiltyNodeInfoForInputText() {
AccessibilityNodeInfo info = mInputText.createAccessibilityNodeInfo();
info.setSource(NumberPicker.this, VIRTUAL_VIEW_ID_INPUT);
if (mAccessibilityFocusedView != VIRTUAL_VIEW_ID_INPUT) {
info.addAction(AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS);
}
if (mAccessibilityFocusedView == VIRTUAL_VIEW_ID_INPUT) {
info.addAction(AccessibilityNodeInfo.ACTION_CLEAR_ACCESSIBILITY_FOCUS);
}
return info;
}
示例14: createAccessibilityNodeInfoForVirtualButton
import android.view.accessibility.AccessibilityNodeInfo; //导入方法依赖的package包/类
private AccessibilityNodeInfo createAccessibilityNodeInfoForVirtualButton(int virtualViewId,
String text, int left, int top, int right, int bottom) {
AccessibilityNodeInfo info = AccessibilityNodeInfo.obtain();
info.setClassName(Button.class.getName());
info.setPackageName(getContext().getPackageName());
info.setSource(NumberPicker.this, virtualViewId);
info.setParent(NumberPicker.this);
info.setText(text);
info.setClickable(true);
info.setLongClickable(true);
info.setEnabled(NumberPicker.this.isEnabled());
Rect boundsInParent = mTempRect;
boundsInParent.set(left, top, right, bottom);
// TODO info.setVisibleToUser(isVisibleToUser(boundsInParent));
info.setBoundsInParent(boundsInParent);
Rect boundsInScreen = boundsInParent;
int[] locationOnScreen = mTempArray;
getLocationOnScreen(locationOnScreen);
boundsInScreen.offset(locationOnScreen[0], locationOnScreen[1]);
info.setBoundsInScreen(boundsInScreen);
if (mAccessibilityFocusedView != virtualViewId) {
info.addAction(AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS);
}
if (mAccessibilityFocusedView == virtualViewId) {
info.addAction(AccessibilityNodeInfo.ACTION_CLEAR_ACCESSIBILITY_FOCUS);
}
if (NumberPicker.this.isEnabled()) {
info.addAction(AccessibilityNodeInfo.ACTION_CLICK);
}
return info;
}
示例15: onInitializeAccessibilityNodeInfo
import android.view.accessibility.AccessibilityNodeInfo; //导入方法依赖的package包/类
@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)));
}