Skip to content

Commit

Permalink
Add method setChecked(boolean checked, boolean anim). #9
Browse files Browse the repository at this point in the history
  • Loading branch information
ChadCSong committed Sep 5, 2016
1 parent 11cc68e commit 4574d47
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -109,18 +109,24 @@ public void setBtnFillColor(int btnFillColor) {
this.btnFillColor = btnFillColor;
}

public void setChecked(boolean checked) {
public void setChecked(boolean checked, boolean anim) {
isChecked = checked;
if (checked) {
setSrcColor(btnFillColor);
isChecked = true;

This comment has been minimized.

Copy link
@rfazi

rfazi Sep 7, 2016

Remove this because 'isChecked = checked;' do the work.

if (anim) showAnim();
} else {
setSrcColor(btnColor);
isChecked = false;

This comment has been minimized.

Copy link
@rfazi

rfazi Sep 7, 2016

Remove this because 'isChecked = checked;' do the work.

if (anim) setCancel();
}
onListenerUpdate(checked);
}

public void setChecked(boolean checked) {
setChecked(checked, false);
}

private void onListenerUpdate(boolean checked) {
if (listener != null) {
listener.onCheckedChanged(this, checked);
Expand Down

0 comments on commit 4574d47

Please sign in to comment.