本文整理匯總了Java中android.support.v4.view.accessibility.AccessibilityNodeInfoCompat.ACTION_CLICK屬性的典型用法代碼示例。如果您正苦於以下問題:Java AccessibilityNodeInfoCompat.ACTION_CLICK屬性的具體用法?Java AccessibilityNodeInfoCompat.ACTION_CLICK怎麽用?Java AccessibilityNodeInfoCompat.ACTION_CLICK使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類android.support.v4.view.accessibility.AccessibilityNodeInfoCompat
的用法示例。
在下文中一共展示了AccessibilityNodeInfoCompat.ACTION_CLICK屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getAction
private String getAction() {
switch (mAction) {
case AccessibilityNodeInfoCompat.ACTION_CLICK:
return "click()";
case AccessibilityNodeInfoCompat.ACTION_LONG_CLICK:
return "longClick()";
case AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD:
return "scrollBackward()";
case AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD:
return "scrollForward()";
case AccessibilityNodeInfoCompat.ACTION_SET_TEXT:
return "setText(\"\")";
}
return "";
}
示例2: performActionForKey
/**
* Performs the specified accessibility action for the given key.
*
* @param key The on which to perform the action.
* @param action The action to perform.
* @return The result of performing the action, or false if the action is not supported.
*/
boolean performActionForKey(final Key key, final int action) {
switch (action) {
case AccessibilityNodeInfoCompat.ACTION_ACCESSIBILITY_FOCUS:
mAccessibilityFocusedView = getVirtualViewIdOf(key);
sendAccessibilityEventForKey(
key, AccessibilityEventCompat.TYPE_VIEW_ACCESSIBILITY_FOCUSED);
return true;
case AccessibilityNodeInfoCompat.ACTION_CLEAR_ACCESSIBILITY_FOCUS:
mAccessibilityFocusedView = UNDEFINED;
sendAccessibilityEventForKey(
key, AccessibilityEventCompat.TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED);
return true;
case AccessibilityNodeInfoCompat.ACTION_CLICK:
sendAccessibilityEventForKey(key, AccessibilityEvent.TYPE_VIEW_CLICKED);
mDelegate.performClickOn(key);
return true;
case AccessibilityNodeInfoCompat.ACTION_LONG_CLICK:
sendAccessibilityEventForKey(key, AccessibilityEvent.TYPE_VIEW_LONG_CLICKED);
mDelegate.performLongClickOn(key);
return true;
default:
return false;
}
}
開發者ID:sergeychilingaryan,項目名稱:AOSP-Kayboard-7.1.2,代碼行數:31,代碼來源:KeyboardAccessibilityNodeProvider.java
示例3: onPerformActionForVirtualView
@Override
protected boolean onPerformActionForVirtualView(int viewId, int action, Bundle args) {
if (action == AccessibilityNodeInfoCompat.ACTION_CLICK && viewId != INVALID_ID) {
String confirmation = getConfirmationForIconDrop(viewId);
mDelegate.handleAccessibleDrop(mView, getItemBounds(viewId), confirmation);
return true;
}
return false;
}
示例4: onPerformActionForVirtualView
@Override
protected boolean onPerformActionForVirtualView(
int virtualViewId, int action, Bundle arguments) {
switch (action) {
case AccessibilityNodeInfoCompat.ACTION_CLICK:
return true;
}
return false;
}
示例5: performAccessibilityAction
@Override
public boolean performAccessibilityAction(View host, int action,
Bundle arguments) {
if (super.performAccessibilityAction(host, action, arguments)) {
return true;
}
final int position = getPositionForView(host);
final ListAdapter adapter = getAdapter();
if ((position == INVALID_POSITION) || (adapter == null)) {
// Cannot perform actions on invalid items.
return false;
}
if (!isEnabled() || !adapter.isEnabled(position)) {
// Cannot perform actions on disabled items.
return false;
}
final long id = getItemIdAtPosition(position);
switch (action) {
case AccessibilityNodeInfoCompat.ACTION_CLEAR_SELECTION: {
if (getSelectedItemPosition() == position) {
setSelection(INVALID_POSITION);
return true;
}
}
return false;
case AccessibilityNodeInfoCompat.ACTION_SELECT: {
if (getSelectedItemPosition() != position) {
setSelection(position);
return true;
}
}
return false;
case AccessibilityNodeInfoCompat.ACTION_CLICK: {
if (isClickable()) {
return performItemClick(host, position, id);
}
}
return false;
case AccessibilityNodeInfoCompat.ACTION_LONG_CLICK: {
if (isLongClickable()) {
return performLongPress(host, position, id);
}
}
return false;
}
return false;
}
示例6: ClickActionDelegate
public ClickActionDelegate(Context context, int resId) {
mClickAction = new AccessibilityNodeInfoCompat.AccessibilityActionCompat(AccessibilityNodeInfoCompat.ACTION_CLICK, context.getString(resId));
/*mClickAction = new AccessibilityAction(
AccessibilityNodeInfo.ACTION_CLICK, context.getString(resId));*/
}