当前位置: 首页>>代码示例>>Java>>正文


Java AccessibilityNodeInfo.addAction方法代码示例

本文整理汇总了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);
		}
	}
}
 
开发者ID:junchenChow,项目名称:exciting-app,代码行数:17,代码来源:AbsHListView.java

示例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);
  }
}
 
开发者ID:yangchaojiang,项目名称:yjPlay,代码行数:18,代码来源:DefaultTimeBar.java

示例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);
    }
}
 
开发者ID:rubensousa,项目名称:PreviewSeekBar,代码行数:18,代码来源:CustomTimeBar.java

示例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);
}
 
开发者ID:ttpho,项目名称:TimePicker,代码行数:11,代码来源:RadialPickerLayout.java

示例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);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:12,代码来源:RadialPickerLayout.java

示例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));
    }
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:15,代码来源:OverviewScreenAccessibilityDelegate.java

示例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)));
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:14,代码来源:OverviewAccessibilityDelegate.java

示例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));
        }
    }
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:12,代码来源:ShortcutMenuAccessibilityDelegate.java

示例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));
    }
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:37,代码来源:LauncherAccessibilityDelegate.java

示例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));
    }
}
 
开发者ID:TeamBrainStorm,项目名称:SimpleUILauncher,代码行数:15,代码来源:OverviewScreenAccessibilityDelegate.java

示例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);
    }
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:18,代码来源:RadialPickerLayout.java

示例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);
    }
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:18,代码来源:DayPickerView.java

示例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;
}
 
开发者ID:SavorGit,项目名称:Hotspot-master-devp,代码行数:12,代码来源:NumberPicker.java

示例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;
}
 
开发者ID:SavorGit,项目名称:Hotspot-master-devp,代码行数:34,代码来源:NumberPicker.java

示例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)));
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:14,代码来源:OverviewAccessibilityDelegate.java


注:本文中的android.view.accessibility.AccessibilityNodeInfo.addAction方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。