Android custom checkbox based on SmoothCheckBox
compile 'net.igenius:customcheckbox:1.3'
Attr | Type | Description |
---|---|---|
duration | integer | Animation Duration |
stroke_width | dimension | The border width when unchecked |
color_tick | color | Tick color (visible only when checked) |
color_checked | color | Fill color when selected |
color_unchecked | color | Fill color when unchecked |
color_unchecked_stroke | color | Border color when unchecked |
setChecked(boolean checked); //by default, it's wthout animation
setChecked(boolean checked, boolean animate); //pass true to animate
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sample);
final CustomCheckBox scb = (CustomCheckBox) findViewById(R.id.scb);
scb.setOnCheckedChangeListener(new CustomCheckBox.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CustomCheckBox checkBox, boolean isChecked) {
Log.d("CustomCheckBox", String.valueOf(isChecked));
}
});
}
To publish on bintray, simply execute: ./gradlew clean assembleRelease bintrayUpload