Use correct checked value when animating Switch

BUG: 16984959
Change-Id: I1b4ffea568619663e26c097a28b86579d090c0ce
This commit is contained in:
Alan Viverette
2014-08-12 15:13:19 -07:00
parent 61da0fdfee
commit 467d629ca7

View File

@@ -833,6 +833,10 @@ public class Switch extends CompoundButton {
public void setChecked(boolean checked) {
super.setChecked(checked);
// Calling the super method may result in setChecked() getting called
// recursively with a different value, so load the REAL value...
checked = isChecked();
if (isAttachedToWindow() && isLaidOut()) {
animateThumbToCheckedState(checked);
} else {