List of usage examples for android.graphics.drawable LayerDrawable setColorFilter
public void setColorFilter(@ColorInt int color, @NonNull PorterDuff.Mode mode)
From source file:net.xpece.android.colorpicker.ColorStateDrawable.java
public static Drawable create(Drawable[] layers, int color, int pressed) { if (Build.VERSION.SDK_INT >= 21) { LayerDrawable ld = new LayerDrawable(layers); ld.setColorFilter(color, PorterDuff.Mode.SRC_IN); RippleDrawable rd = new RippleDrawable(ColorStateList.valueOf(pressed), ld, null); return rd; } else {/*from w w w . j av a2 s . c o m*/ return new ColorStateDrawable(layers, color, pressed); } }