Search in sources :

Example 1 with TintedView

use of carbon.view.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) AnimatedColorStateList(carbon.animation.AnimatedColorStateList) TintedView(carbon.view.TintedView)

Aggregations

ColorStateList (android.content.res.ColorStateList)1 AnimatedColorStateList (carbon.animation.AnimatedColorStateList)1 TintedView (carbon.view.TintedView)1