Skip to content

Commit

Permalink
Postpone checked state notification.
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3z committed Apr 14, 2018
1 parent 9f46b4d commit 0c8558a
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,16 @@ public void setChecked(boolean checked) {
if (mBroadcasting) {
return;
}
mBroadcasting = true;
if (mOnCheckedWidgetListener != null) {
mOnCheckedWidgetListener.onCheckedChanged(this, mChecked);
}
mBroadcasting = false;
this.post(new Runnable() {
@Override
public void run() {
mBroadcasting = true;
if (mOnCheckedWidgetListener != null) {
mOnCheckedWidgetListener.onCheckedChanged(CompoundToggleButton.this, mChecked);
}
mBroadcasting = false;
}
});
}
}

Expand Down

0 comments on commit 0c8558a

Please sign in to comment.