public static int getImportantForAccessibility(View view) { return view.getImportantForAccessibility(); }
// 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; }
/** * 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 ); }
int mode = view.getImportantForAccessibility(); if ((mode == View.IMPORTANT_FOR_ACCESSIBILITY_NO) || (mode == View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS)) { if (((View) parent).getImportantForAccessibility() == View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS) { return false;
data.put("CameraDistance", v.getCameraDistance()); data.put("IsImportantForA11Y", translator.importantForA11Y(v.getImportantForAccessibility())); data.put("MinWidth", v.getMinimumWidth()); data.put("MinHeight", v.getMinimumHeight());
if ( child.getImportantForAccessibility() == IMPORTANT_FOR_ACCESSIBILITY_AUTO ) { child.setImportantForAccessibility( IMPORTANT_FOR_ACCESSIBILITY_YES ); if ( child.getImportantForAccessibility() == IMPORTANT_FOR_ACCESSIBILITY_AUTO ) { 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 (view.getImportantForAccessibility() == IMPORTANT_FOR_ACCESSIBILITY_AUTO) { view.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_YES);