package com.chaoran.entiry;

import com.activity.chaoran.R;

import android.content.Context;
import android.util.TypedValue;
import android.widget.CheckBox;
import android.widget.CompoundButton;

public class SelfCheckBox extends CheckBox {

	public SelfCheckBox(Context context) {
		super(context);
		setButtonDrawable(R.drawable.checkbox_empty); 
		this.setPadding((int) TypedValue.applyDimension(
				TypedValue.COMPLEX_UNIT_DIP, 24, context.getResources()
				.getDisplayMetrics()), 0, 0,0);
		setOnCheckedChangeListener(new OnCheckedChangeListener(){
	            @Override  
	            public void onCheckedChanged(CompoundButton buttonView,  
	                    boolean isChecked) {  
	                // TODO Auto-generated method stub  
	                if(isChecked){  
	                	setButtonDrawable(R.drawable.checkbox_full);  
	                }else{  
	                	setButtonDrawable(R.drawable.checkbox_empty); 
	                }  
	            }  
	        });  

		// TODO Auto-generated constructor stub
	}

}
