Search in sources :

Example 1 with TintedView

use of carbon.widget.TintedView in project Carbon by ZieIony.

the class Carbon method getBackgroundTintAlpha.

public static float getBackgroundTintAlpha(View child) {
    if (!(child instanceof TintedView))
        return 255;
    ColorStateList tint = ((TintedView) child).getBackgroundTint();
    if (tint == null)
        return 255;
    int color = tint.getColorForState(child.getDrawableState(), tint.getDefaultColor());
    return (color >> 24) & 0xff;
}
Also used : ColorStateList(android.content.res.ColorStateList) TintedView(carbon.widget.TintedView)

Aggregations

ColorStateList (android.content.res.ColorStateList)1 TintedView (carbon.widget.TintedView)1