Java Code Examples for android.view.accessibility.AccessibilityNodeInfo#ACTION_CLEAR_FOCUS
The following examples show how to use
android.view.accessibility.AccessibilityNodeInfo#ACTION_CLEAR_FOCUS .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BrowserAccessibilityManager.java From android-chromium with BSD 2-Clause "Simplified" License | 5 votes |
/** * @see AccessibilityNodeProvider#performAction(int, int, Bundle) */ protected boolean performAction(int virtualViewId, int action, Bundle arguments) { if (!mAccessibilityManager.isEnabled() || mNativeObj == 0) { return false; } switch (action) { case AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS: if (mAccessibilityFocusId == virtualViewId) { return true; } mAccessibilityFocusId = virtualViewId; sendAccessibilityEvent(mAccessibilityFocusId, AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED); return true; case AccessibilityNodeInfo.ACTION_CLEAR_ACCESSIBILITY_FOCUS: if (mAccessibilityFocusId == virtualViewId) { mAccessibilityFocusId = View.NO_ID; } return true; case AccessibilityNodeInfo.ACTION_CLICK: nativeClick(mNativeObj, virtualViewId); break; case AccessibilityNodeInfo.ACTION_FOCUS: nativeFocus(mNativeObj, virtualViewId); break; case AccessibilityNodeInfo.ACTION_CLEAR_FOCUS: nativeBlur(mNativeObj); break; default: break; } return false; }
Example 2
Source File: BrowserAccessibilityManager.java From android-chromium with BSD 2-Clause "Simplified" License | 5 votes |
/** * @see AccessibilityNodeProvider#performAction(int, int, Bundle) */ protected boolean performAction(int virtualViewId, int action, Bundle arguments) { if (!mAccessibilityManager.isEnabled() || mNativeObj == 0) { return false; } switch (action) { case AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS: if (mAccessibilityFocusId == virtualViewId) { return true; } mAccessibilityFocusId = virtualViewId; sendAccessibilityEvent(mAccessibilityFocusId, AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED); return true; case AccessibilityNodeInfo.ACTION_CLEAR_ACCESSIBILITY_FOCUS: if (mAccessibilityFocusId == virtualViewId) { mAccessibilityFocusId = View.NO_ID; } return true; case AccessibilityNodeInfo.ACTION_CLICK: nativeClick(mNativeObj, virtualViewId); break; case AccessibilityNodeInfo.ACTION_FOCUS: nativeFocus(mNativeObj, virtualViewId); break; case AccessibilityNodeInfo.ACTION_CLEAR_FOCUS: nativeBlur(mNativeObj); break; default: break; } return false; }