public void setVisibility ( int visibility ) { if ( this . visibility != visibility ) { final boolean hasSpace = this . visibility == View . VISIBLE || this . visibility == View . INVISIBLE ; final boolean removingSpace = visibility == View . GONE ; final boolean change = hasSpace && removingSpace ; this . visibility = visibility ; // Only change the dataset if it is absolutely necessary if ( change && mAdapterDataSetObserver != null ) { mAdapterDataSetObserver . onChanged ( ) ; } else { invalidate ( ) ; } } }
Set the enabled state of this view .