@Override
    public int getOpacity() {
        final Paint p = mPaint;
        if (p.getXfermode() == null) {
            final int alpha = p.getAlpha();
            if (alpha == 0) {
                return PixelFormat.TRANSPARENT;
            }
            if (alpha == 255) {
                return PixelFormat.OPAQUE;
            }
        }
        // not sure, so be safe
        return PixelFormat.TRANSLUCENT;
    }
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