checkbox.xml
checkbox.java
checkbox.java
import android.content.Context;
import android.graphics.Color;
import android.util.AttributeSet;
import android.widget.CheckBox;
public class checkbox extends CheckBox {
public checkbox(Context context, AttributeSet attrs) {
super(context, attrs);
// setButtonDrawable(new StateListDrawable());
}
@Override
public void setChecked(boolean t) {
if (t) {
this.setBackgroundResource(R.drawable.chk_blue_bg);
this.setTextColor(Color.WHITE);
} else {
this.setBackgroundResource(R.drawable.chk_white_bg);
this.setTextColor(Color.BLACK);
}
super.setChecked(t);
}
}
0 comments:
Post a Comment