This CL is not working (even after careful testing) but when I tried I was not completely ToT.
Revert "Fix bug #15170508 When I initially load settings, all on/off toggles start in off position then move to on after pane loads"
This reverts commit 1e52db8063.
Change-Id: I73bdfeba4a4b3e993e37cdae1e3733ffe272b9eb
This commit is contained in:
@@ -40,6 +40,7 @@ public abstract class ToggleFeaturePreferenceFragment
|
||||
extends SettingsPreferenceFragment {
|
||||
|
||||
protected SwitchBar mSwitchBar;
|
||||
protected ToggleSwitch mToggleSwitch;
|
||||
|
||||
protected String mPreferenceKey;
|
||||
protected Preference mSummaryPreference;
|
||||
@@ -88,6 +89,7 @@ public abstract class ToggleFeaturePreferenceFragment
|
||||
|
||||
SettingsActivity activity = (SettingsActivity) getActivity();
|
||||
mSwitchBar = activity.getSwitchBar();
|
||||
mToggleSwitch = mSwitchBar.getSwitch();
|
||||
|
||||
onProcessArguments(getArguments());
|
||||
}
|
||||
@@ -130,7 +132,7 @@ public abstract class ToggleFeaturePreferenceFragment
|
||||
}
|
||||
|
||||
private void removeActionBarToggleSwitch() {
|
||||
mSwitchBar.setSwitchOnBeforeCheckedChangeListener(null);
|
||||
mToggleSwitch.setOnBeforeCheckedChangeListener(null);
|
||||
onRemoveSwitchBarToggleSwitch();
|
||||
mSwitchBar.hide();
|
||||
}
|
||||
@@ -151,7 +153,7 @@ public abstract class ToggleFeaturePreferenceFragment
|
||||
// Enabled.
|
||||
if (arguments.containsKey(AccessibilitySettings.EXTRA_CHECKED)) {
|
||||
final boolean enabled = arguments.getBoolean(AccessibilitySettings.EXTRA_CHECKED);
|
||||
mSwitchBar.setSwitchChecked(enabled);
|
||||
mToggleSwitch.setCheckedInternal(enabled);
|
||||
}
|
||||
|
||||
// Title.
|
||||
|
||||
Reference in New Issue
Block a user