Loading core/java/android/widget/Switch.java +3 −3 Original line number Diff line number Diff line Loading @@ -507,13 +507,13 @@ public class Switch extends CompoundButton { } private boolean getTargetCheckedState() { return mThumbPosition <= getThumbScrollRange() / 2; return mThumbPosition >= getThumbScrollRange() / 2; } @Override public void setChecked(boolean checked) { super.setChecked(checked); mThumbPosition = checked ? 0 : getThumbScrollRange(); mThumbPosition = checked ? getThumbScrollRange() : 0; invalidate(); } Loading @@ -521,7 +521,7 @@ public class Switch extends CompoundButton { protected void onLayout(boolean changed, int left, int top, int right, int bottom) { super.onLayout(changed, left, top, right, bottom); mThumbPosition = isChecked() ? 0 : getThumbScrollRange(); mThumbPosition = isChecked() ? getThumbScrollRange() : 0; int switchRight = getWidth() - getPaddingRight(); int switchLeft = switchRight - mSwitchWidth; Loading Loading
core/java/android/widget/Switch.java +3 −3 Original line number Diff line number Diff line Loading @@ -507,13 +507,13 @@ public class Switch extends CompoundButton { } private boolean getTargetCheckedState() { return mThumbPosition <= getThumbScrollRange() / 2; return mThumbPosition >= getThumbScrollRange() / 2; } @Override public void setChecked(boolean checked) { super.setChecked(checked); mThumbPosition = checked ? 0 : getThumbScrollRange(); mThumbPosition = checked ? getThumbScrollRange() : 0; invalidate(); } Loading @@ -521,7 +521,7 @@ public class Switch extends CompoundButton { protected void onLayout(boolean changed, int left, int top, int right, int bottom) { super.onLayout(changed, left, top, right, bottom); mThumbPosition = isChecked() ? 0 : getThumbScrollRange(); mThumbPosition = isChecked() ? getThumbScrollRange() : 0; int switchRight = getWidth() - getPaddingRight(); int switchLeft = switchRight - mSwitchWidth; Loading