Code example for PorterDuffXfermode

0
    private final RectF mRect = new RectF();
    private final RectF mRectInner = new RectF();
    private final Paint mPaintForeground = new Paint();
    private final Paint mPaintBackground = new Paint();
    private final Paint mPaintErase = new Paint();
    private static final Xfermode PORTER_DUFF_CLEAR = new PorterDuffXfermode(PorterDuff.Mode.CLEAR);
    private int mColorForeground = Color.WHITE;
    private int mColorBackground = Color.BLACK;
    private float mValue;
    private boolean mPieStyle;
    /** 
     * Value which makes our custom drawn indicator have roughly the same size 
     * as the built-in ProgressBar indicator. Unit: dp 
     */ 
    private static final float PADDING = 4;
    private float mPadding;
    private Bitmap mBitmap;
    /** 
     * Value which makes our custom drawn indicator have roughly the same 
     * thickness as the built-in ProgressBar indicator. Expressed as the ration 
     * between the inner and outer radiuses