Fix bug #15170508 When I initially load settings, all on/off toggles start in off position then move to on after pane loads
- refactor all the code that was using the Switch to control it thru the SwitchBar - start the Switch as View.GONE and make it View.VISIBLE when it is set as "enabled" or "checked" so that you dont see the Switch transition (it shows only with it final state) Change-Id: I382076bf3c819c530b5b2c06ca2429dfb2cdc6bf
This commit is contained in:
@@ -32,10 +32,10 @@ public class ToggleScreenMagnificationPreferenceFragment
|
||||
@Override
|
||||
protected void onInstallSwitchBarToggleSwitch() {
|
||||
super.onInstallSwitchBarToggleSwitch();
|
||||
mToggleSwitch.setOnBeforeCheckedChangeListener(new OnBeforeCheckedChangeListener() {
|
||||
mSwitchBar.setSwitchOnBeforeCheckedChangeListener(new OnBeforeCheckedChangeListener() {
|
||||
@Override
|
||||
public boolean onBeforeCheckedChanged(ToggleSwitch toggleSwitch, boolean checked) {
|
||||
toggleSwitch.setCheckedInternal(checked);
|
||||
mSwitchBar.setSwitchChecked(checked);
|
||||
getArguments().putBoolean(AccessibilitySettings.EXTRA_CHECKED, checked);
|
||||
onPreferenceToggled(mPreferenceKey, checked);
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user