public final void setVisibility ( final int visibility , final boolean animate ) { boolean visible = visibility == View . VISIBLE ; Boolean tag = ( Boolean ) getTag ( ) ; setTag ( visible ) ; if ( animate ) { if ( tag == null || tag != visible ) { if ( getAnimation ( ) != null ) { getAnimation ( ) . cancel ( ) ; } animate ( ) . alpha ( visible ? 1 : 0 ) . setDuration ( getResources ( ) . getInteger ( android . R . integer . config_mediumAnimTime ) ) . setListener ( createVisibilityAnimationListener ( visible ) ) . start ( ) ; } } else { super . setVisibility ( visible ? View . VISIBLE : View . INVISIBLE ) ; } }
Sets the visibility of the divider .