@Override
    public void draw(Canvas canvas) {
        final Paint paint = mPaint;
        final int prevAlpha = paint.getAlpha();
        paint.setAlpha(Ui.modulateAlpha(prevAlpha, getAlpha()));
        // only draw shape if it may affect output
        if (paint.getAlpha() != 0 || paint.getXfermode() != null /*|| paint.hasShadowLayer()*/) {
            final boolean clearColorFilter;
            if (mTintFilter != null && paint.getColorFilter() == null) {
                paint.setColorFilter(mTintFilter);
                clearColorFilter = true;
            } else {
                clearColorFilter = false;
            }

            // call draw
            draw(canvas, mPaint);

            if (clearColorFilter) {
                paint.setColorFilter(null);
            }
        }
        // restore
        paint.setAlpha(prevAlpha);
    }
Initializes local dynamic properties from state. This should be called
after significant state changes, e.g. from the One True Constructor and
after inflating or applying a theme.

@param tintStateList ColorStateList
caprice/ui/src/main/java/net/qiujuer/genius/ui/drawable/StatePaintDrawable.java