labeledView.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES); labeledView.setClickable(true); unlabeledView.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES); unlabeledView.setClickable(true); shadowOf(unlabeledView).setGlobalVisibleRect(validViewBounds);
public static void setImportantForAccessibility(View view, int mode) { view.setImportantForAccessibility(mode); }
@Override protected void enableAccessibleDrag(boolean enable) { super.enableAccessibleDrag(enable); mFooter.setImportantForAccessibility(enable ? IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS : IMPORTANT_FOR_ACCESSIBILITY_AUTO); } });
@Override protected void enableAccessibleDrag(boolean enable) { super.enableAccessibleDrag(enable); mFooter.setImportantForAccessibility(enable ? IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS : IMPORTANT_FOR_ACCESSIBILITY_AUTO); } });
@Override protected void enableAccessibleDrag(boolean enable) { super.enableAccessibleDrag(enable); mFooter.setImportantForAccessibility(enable ? IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS : IMPORTANT_FOR_ACCESSIBILITY_AUTO); } });
// method setEmptyView on ListView @android.view.RemotableViewMethod public void setEmptyView(View emptyView) { mEmptyView = emptyView; // If not explicitly specified this view is important for accessibility. if (emptyView != null && emptyView.getImportantForAccessibility() == IMPORTANT_FOR_ACCESSIBILITY_AUTO) { emptyView.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_YES); } final T adapter = getAdapter(); final boolean empty = ((adapter == null) || adapter.isEmpty()); // <- see that updateEmptyStatus(empty); } // meanwhile, on ArrayAdapter... // adapter.isEmpty returns getCount! public boolean isEmpty() { return getCount() == 0; }
@SuppressLint("NewApi") public static void setAccessibilityIgnore(View view) { view.setClickable(false); view.setFocusable(false); view.setContentDescription(""); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { view.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO); } }
private void setNotClickable(View view) { view.setClickable(false); view.setFocusable(false); view.setContentDescription(""); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { view.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO); } } }
public static void setAccessiblityIgnore(View view) { view.setClickable(false); view.setFocusable(false); view.setContentDescription(""); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { view.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO); } }
private void setNotClickable(View view) { view.setClickable(false); view.setFocusable(false); view.setContentDescription(""); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { view.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO); } } }
/** * Creates an icon for the given NotificationInfo, and adds it to the icon row. * @return the icon view that was added */ private View addNotificationIconForInfo(NotificationInfo info) { View icon = new View(getContext()); icon.setBackground(info.getIconForBackground(getContext(), mBackgroundColor)); icon.setOnClickListener(info); icon.setTag(info); icon.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO); mIconRow.addView(icon, 0, mIconLayoutParams); return icon; }
/** * Sets the view to show if the adapter is empty */ @TargetApi(16) public void setEmptyView( View emptyView ) { mEmptyView = emptyView; if( android.os.Build.VERSION.SDK_INT >= 16 ) { // If not explicitly specified this view is important for accessibility. if ( emptyView != null && emptyView.getImportantForAccessibility() == IMPORTANT_FOR_ACCESSIBILITY_AUTO ) { emptyView.setImportantForAccessibility( IMPORTANT_FOR_ACCESSIBILITY_YES ); } } final T adapter = getAdapter(); final boolean empty = ( ( adapter == null ) || adapter.isEmpty() ); updateEmptyStatus( empty ); }
@Override public void enableAccessibleDrag(boolean enable) { mLauncher.getSearchDropTargetBar().enableAccessibleDrag(enable); for (int i = 0; i < mContent.getChildCount(); i++) { mContent.getPageAt(i).enableAccessibleDrag(enable, CellLayout.FOLDER_ACCESSIBILITY_DRAG); } mFooter.setImportantForAccessibility(enable ? IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS : IMPORTANT_FOR_ACCESSIBILITY_AUTO); mLauncher.getWorkspace().setAddNewPageOnDrag(!enable); }
parent.addView(view, buttonParams); view.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO); view.setOnClickListener(OptionSection.this); return view;
child.setImportantForAccessibility( IMPORTANT_FOR_ACCESSIBILITY_YES ); child.setImportantForAccessibility( IMPORTANT_FOR_ACCESSIBILITY_YES );
/** * 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. */ 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); } }
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { if (view.getImportantForAccessibility() == IMPORTANT_FOR_ACCESSIBILITY_AUTO) { view.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_YES);