Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;

import android.graphics.drawable.Drawable;
import android.widget.ImageView;

public class Main {
    public static void setIconColor(ImageView icon, int color) {
        Drawable iconDrawable = icon.getDrawable();
        icon.setColorFilter(new PorterDuffColorFilter(color, PorterDuff.Mode.SRC_ATOP));
        icon.setImageDrawable(iconDrawable);
    }
}