Code example for Drawable

Methods: setVisible

0
 
    @Override 
    public void setVisibility(int visibility) {
        super.setVisibility(visibility);
        final boolean isVisible = visibility == VISIBLE;
        if (mBackground != null) mBackground.setVisible(isVisible, false);
        if (mStackedBackground != null) mStackedBackground.setVisible(isVisible, false);
        if (mSplitBackground != null) mSplitBackground.setVisible(isVisible, false);
    } 
 
    @Override 
    protected boolean verifyDrawable(Drawable who) {
        return (who == mBackground && !mIsSplit) || (who == mStackedBackground && mIsStacked) ||
                (who == mSplitBackground && mIsSplit) || super.verifyDrawable(who);
    } 
 
    @Override 
    protected void drawableStateChanged() { 
        super.drawableStateChanged(); 
        if (mBackground != null && mBackground.isStateful()) {
            mBackground.setState(getDrawableState());