Code example for Resources

Methods: getDrawable

0
            return mRealDrawable.getOpacity();
        } 
    } 
 
    public TargetDrawable(Resources res, int resId) {
        this(res, resId == 0 ? null : res.getDrawable(resId));
    } 
 
    public TargetDrawable(Resources res, Drawable drawable) {
        // Mutate the drawable so we can animate shared drawable properties. 
        mDrawable = drawable != null ? drawable.mutate() : null;
        resizeDrawables(); 
        setState(STATE_INACTIVE);
    } 
 
    public void setState(int [] state) {
        if (mDrawable instanceof StateListDrawable) {
            StateListDrawable d = (StateListDrawable) mDrawable;
            d.setState(state);
        } 
    }