當前位置: 首頁>>代碼示例>>Java>>正文


Java AccessibilityNodeInfoCompat.ACTION_CLICK屬性代碼示例

本文整理匯總了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 "";
}
 
開發者ID:hyb1996,項目名稱:Auto.js,代碼行數:18,代碼來源:CodeGenerator.java

示例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;
}
 
開發者ID:enricocid,項目名稱:LaunchEnr,代碼行數:9,代碼來源:DragAndDropAccessibilityDelegate.java

示例4: onPerformActionForVirtualView

@Override
protected boolean onPerformActionForVirtualView(
        int virtualViewId, int action, Bundle arguments) {
    switch (action) {
        case AccessibilityNodeInfoCompat.ACTION_CLICK:
            return true;
    }

    return false;
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:10,代碼來源:CompositorViewHolder.java

示例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;
}
 
開發者ID:junchenChow,項目名稱:exciting-app,代碼行數:53,代碼來源:AbsHListView.java

示例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));*/
}
 
開發者ID:Gericop,項目名稱:DateTimePicker,代碼行數:5,代碼來源:TimePickerClockDelegate.java


注:本文中的android.support.v4.view.accessibility.AccessibilityNodeInfoCompat.ACTION_CLICK屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。