List of usage examples for android.view View IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS
int IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS
To view the source code for android.view View IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS.
Click Source Link
From source file:com.google.android.apps.common.testing.accessibility.framework.ViewAccessibilityUtils.java
/** * @see View#isImportantForAccessibility() *//*w w w .j av a2s .c om*/ public static boolean isImportantForAccessibility(View view) { if (view == null) { return false; } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { return view.isImportantForAccessibility(); } else { // On earlier APIs, we must piece together accessibility importance from the available // properties. We return false incorrectly for some cases where unretrievable listeners // prevent us from determining importance. // If the developer marked the view as explicitly not important, it isn't. int mode = view.getImportantForAccessibility(); if ((mode == View.IMPORTANT_FOR_ACCESSIBILITY_NO) || (mode == View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS)) { return false; } // No parent view can be hiding us. (APIs 19 to 21) ViewParent parent = view.getParent(); while (parent instanceof View) { if (((View) parent) .getImportantForAccessibility() == View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS) { return false; } parent = parent.getParent(); } // Interrogate the view's other properties to determine importance. return (mode == View.IMPORTANT_FOR_ACCESSIBILITY_YES) || isActionableForAccessibility(view) || hasListenersForAccessibility(view) || (view.getAccessibilityNodeProvider() != null) || (ViewCompat.getAccessibilityLiveRegion(view) != ViewCompat.ACCESSIBILITY_LIVE_REGION_NONE); } }
From source file:org.chromium.chrome.browser.autofill.CardUnmaskPrompt.java
/** * Updates the verification overlay and main contents such that the overlay has |visibility|. * @param visibility A View visibility enumeration value. */// w w w . jav a 2 s .c om private void setOverlayVisibility(int visibility) { mVerificationOverlay.setVisibility(visibility); mControlsContainer.setAlpha(1f); boolean contentsShowing = visibility == View.GONE; if (!contentsShowing) { int durationMs = 250; mVerificationOverlay.setAlpha(0f); mVerificationOverlay.animate().alpha(1f).setDuration(durationMs); mControlsContainer.animate().alpha(0f).setDuration(durationMs); } ViewCompat.setImportantForAccessibility(mControlsContainer, contentsShowing ? View.IMPORTANT_FOR_ACCESSIBILITY_AUTO : View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS); mControlsContainer.setDescendantFocusability( contentsShowing ? ViewGroup.FOCUS_BEFORE_DESCENDANTS : ViewGroup.FOCUS_BLOCK_DESCENDANTS); }
From source file:com.klinker.android.launcher.launcher3.Launcher.java
public boolean setLauncherCallbacks(LauncherCallbacks callbacks) { mLauncherCallbacks = callbacks;/* w w w. j av a 2 s .c o m*/ mLauncherCallbacks.setLauncherSearchCallback(new Launcher.LauncherSearchCallbacks() { private boolean mWorkspaceImportanceStored = false; private boolean mHotseatImportanceStored = false; private int mWorkspaceImportanceForAccessibility = View.IMPORTANT_FOR_ACCESSIBILITY_AUTO; private int mHotseatImportanceForAccessibility = View.IMPORTANT_FOR_ACCESSIBILITY_AUTO; @Override public void onSearchOverlayOpened() { if (mWorkspaceImportanceStored || mHotseatImportanceStored) { return; } // The underlying workspace and hotseat are temporarily suppressed by the search // overlay. So they sholudn't be accessible. if (mWorkspace != null) { mWorkspaceImportanceForAccessibility = mWorkspace.getImportantForAccessibility(); mWorkspace.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS); mWorkspaceImportanceStored = true; } if (mHotseat != null) { mHotseatImportanceForAccessibility = mHotseat.getImportantForAccessibility(); mHotseat.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS); mHotseatImportanceStored = true; } } @Override public void onSearchOverlayClosed() { if (mWorkspaceImportanceStored && mWorkspace != null) { mWorkspace.setImportantForAccessibility(mWorkspaceImportanceForAccessibility); } if (mHotseatImportanceStored && mHotseat != null) { mHotseat.setImportantForAccessibility(mHotseatImportanceForAccessibility); } mWorkspaceImportanceStored = false; mHotseatImportanceStored = false; } }); return true; }
From source file:com.android.launcher3.Launcher.java
public boolean setLauncherCallbacks(LauncherCallbacks callbacks) { mLauncherCallbacks = callbacks;/*from w w w.j a v a2s. c o m*/ mLauncherCallbacks.setLauncherSearchCallback(new Launcher.LauncherSearchCallbacks() { private boolean mWorkspaceImportanceStored = false; private boolean mHotseatImportanceStored = false; private int mWorkspaceImportanceForAccessibility = View.IMPORTANT_FOR_ACCESSIBILITY_AUTO; private int mHotseatImportanceForAccessibility = View.IMPORTANT_FOR_ACCESSIBILITY_AUTO; @Override public void onSearchOverlayOpened() { if (mWorkspaceImportanceStored || mHotseatImportanceStored) { return; } // The underlying workspace and hotseat are temporarily suppressed by the search // overlay. So they shouldn't be accessible. if (mWorkspace != null) { mWorkspaceImportanceForAccessibility = mWorkspace.getImportantForAccessibility(); mWorkspace.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS); mWorkspaceImportanceStored = true; } if (mHotseat != null) { mHotseatImportanceForAccessibility = mHotseat.getImportantForAccessibility(); mHotseat.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS); mHotseatImportanceStored = true; } } @Override public void onSearchOverlayClosed() { if (mWorkspaceImportanceStored && mWorkspace != null) { mWorkspace.setImportantForAccessibility(mWorkspaceImportanceForAccessibility); } if (mHotseatImportanceStored && mHotseat != null) { mHotseat.setImportantForAccessibility(mHotseatImportanceForAccessibility); } mWorkspaceImportanceStored = false; mHotseatImportanceStored = false; } }); return true; }
From source file:android.support.wear.widget.drawer.WearableDrawerLayout.java
private void allowAccessibilityFocusOnOnly(WearableDrawerView drawer) { if (!mIsAccessibilityEnabled) { return;//from w w w.j a v a2 s . c o m } for (int i = 0; i < getChildCount(); i++) { View child = getChildAt(i); if (child != drawer) { child.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS); } } }
From source file:org.chromium.chrome.browser.tab.Tab.java
/** * Update whether or not the current native tab and/or web contents are * currently visible (from an accessibility perspective), or whether * they're obscured by another view./*from w ww . j av a2s .c om*/ */ public void updateAccessibilityVisibility() { View view = getView(); if (view != null) { int importantForAccessibility = isObscuredByAnotherViewForAccessibility() ? View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS : View.IMPORTANT_FOR_ACCESSIBILITY_YES; if (view.getImportantForAccessibility() != importantForAccessibility) { view.setImportantForAccessibility(importantForAccessibility); view.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED); } } ContentViewCore cvc = getContentViewCore(); if (cvc != null) { boolean isWebContentObscured = isObscuredByAnotherViewForAccessibility() || isShowingSadTab(); cvc.setObscuredByAnotherView(isWebContentObscured); } }