set Drawable Filter - Android Graphics

Android examples for Graphics:Drawable Filter

Description

set Drawable Filter

Demo Code


//package com.java2s;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;

public class Main {

    public static void setDrawableFilter(Drawable drawable, int color) {
        if (null != drawable) {
            drawable.setColorFilter(color, PorterDuff.Mode.MULTIPLY);
        }//from w  w w .  ja va  2s  . co  m
    }
}

Related Tutorials