Code example for Drawable

Methods: isStatefulsetState

0
    } 
 
    @Override 
    protected void drawableStateChanged() { 
        Drawable d = mBackground;
        if (d != null && d.isStateful()) {
            d.setState(getDrawableState());
        } 
        super.drawableStateChanged(); 
    } 
 
    @Override 
    public void draw(Canvas canvas) {
        final Drawable background = mBackground;
        if (background != null) {
            final int scrollX = mScrollX;
            final int scrollY = mScrollY;
 
            if (mBackgroundSizeChanged) {
                background.setBounds(0, 0,  mRight - mLeft, mBottom - mTop);
                mBackgroundSizeChanged = false;