set Right Check Box Drawable - Android Graphics

Android examples for Graphics:Drawable

Description

set Right Check Box Drawable

Demo Code


//package com.java2s;
import android.content.Context;
import android.graphics.drawable.Drawable;

import android.widget.CheckBox;

public class Main {
    public static void setRightCheckBoxDrawable(Context context,
            int drawableId, CheckBox box) {
        Drawable drawable = context.getResources().getDrawable(drawableId); // /
        drawable.setBounds(0, 0, drawable.getMinimumWidth(),
                drawable.getMinimumHeight());
        box.setCompoundDrawables(null, null, drawable, null);
    }// ww  w .  j  a  v  a 2 s.  c  o m
}

Related Tutorials