Search in sources :

Example 1 with RippleDrawableMarshmallow

use of carbon.drawable.ripple.RippleDrawableMarshmallow in project Carbon by ZieIony.

the class Carbon method createRippleDrawable.

public static RippleDrawable createRippleDrawable(ColorStateList color, RippleDrawable.Style style, View view, boolean useHotspot, int radius) {
    RippleDrawable rippleDrawable;
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        rippleDrawable = new RippleDrawableMarshmallow(color, style == RippleDrawable.Style.Background ? view.getBackground() : null, style);
    } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        rippleDrawable = new RippleDrawableLollipop(color, style == RippleDrawable.Style.Background ? view.getBackground() : null, style);
    } else {
        rippleDrawable = new RippleDrawableFroyo(color, style == RippleDrawable.Style.Background ? view.getBackground() : null, style);
    }
    rippleDrawable.setCallback(view);
    rippleDrawable.setHotspotEnabled(useHotspot);
    rippleDrawable.setRadius(radius);
    return rippleDrawable;
}
Also used : RippleDrawableFroyo(carbon.drawable.ripple.RippleDrawableFroyo) RippleDrawableMarshmallow(carbon.drawable.ripple.RippleDrawableMarshmallow) RippleDrawableLollipop(carbon.drawable.ripple.RippleDrawableLollipop) RippleDrawable(carbon.drawable.ripple.RippleDrawable)

Example 2 with RippleDrawableMarshmallow

use of carbon.drawable.ripple.RippleDrawableMarshmallow in project Carbon by ZieIony.

the class Carbon method createRippleDrawable.

public static RippleDrawable createRippleDrawable(ColorStateList color, RippleDrawable.Style style, View view, Drawable background, boolean useHotspot, int radius) {
    RippleDrawable rippleDrawable;
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        rippleDrawable = new RippleDrawableMarshmallow(color, background, style);
    } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        rippleDrawable = new RippleDrawableLollipop(color, background, style);
    } else {
        rippleDrawable = new RippleDrawableFroyo(color, background, style);
    }
    rippleDrawable.setCallback(view);
    rippleDrawable.setHotspotEnabled(useHotspot);
    rippleDrawable.setRadius(radius);
    return rippleDrawable;
}
Also used : RippleDrawableFroyo(carbon.drawable.ripple.RippleDrawableFroyo) RippleDrawableMarshmallow(carbon.drawable.ripple.RippleDrawableMarshmallow) RippleDrawableLollipop(carbon.drawable.ripple.RippleDrawableLollipop) RippleDrawable(carbon.drawable.ripple.RippleDrawable)

Aggregations

RippleDrawable (carbon.drawable.ripple.RippleDrawable)2 RippleDrawableFroyo (carbon.drawable.ripple.RippleDrawableFroyo)2 RippleDrawableLollipop (carbon.drawable.ripple.RippleDrawableLollipop)2 RippleDrawableMarshmallow (carbon.drawable.ripple.RippleDrawableMarshmallow)2