Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.graphics.drawable.Drawable;
import android.graphics.drawable.StateListDrawable;

public class Main {
    public static StateListDrawable getCheckedSelectorDrawable(Drawable normal, Drawable pressed) {
        StateListDrawable bg = new StateListDrawable();
        bg.addState(new int[] { android.R.attr.state_checked, android.R.attr.state_enabled }, pressed);
        bg.addState(new int[] { android.R.attr.state_enabled }, normal);
        bg.addState(new int[] {}, normal);
        return bg;
    }
}