Code example for Drawable

Methods: getOpacity

        public void setColorFilter(ColorFilter cf) {
        public int getOpacity() { 
            return mRealDrawable.getOpacity();
    public TargetDrawable(Resources res, int resId) {
        mResourceId = resId;
        setDrawable(res, resId);
    public void setDrawable(Resources res, int resId) {
        // Note we explicitly don't set mResourceId to resId since we allow the drawable to be 
        // swapped at runtime and want to re-use the existing resource id for identification. 
        Drawable drawable = resId == 0 ? null : res.getDrawable(resId);
        // Mutate the drawable so we can animate shared drawable properties. 
        mDrawable = drawable != null ? drawable.mutate() : null;
Connect your IDE to all the code out there  Get Codota for Java