diff options
author | Fabrice Di Meglio <fdimeglio@google.com> | 2014-05-28 02:18:34 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-05-28 02:18:34 +0000 |
commit | 626820962830cd9200f00b7447bddf2c717ecdc1 (patch) | |
tree | 540ae34e4f28efd6b14291a05bd67f7c1ae7e2d3 /src/com/android/settings/location/LocationSettings.java | |
parent | 73f2110e0a31e252c76b3fa41d8014449a1da4b5 (diff) | |
parent | 1e52db8063a0be2254097b4d85527a91d141b505 (diff) | |
download | packages_apps_Settings-626820962830cd9200f00b7447bddf2c717ecdc1.tar.gz packages_apps_Settings-626820962830cd9200f00b7447bddf2c717ecdc1.tar.bz2 packages_apps_Settings-626820962830cd9200f00b7447bddf2c717ecdc1.zip |
Merge "Fix bug #15170508 When I initially load settings, all on/off toggles start in off position then move to on after pane loads"
Diffstat (limited to 'src/com/android/settings/location/LocationSettings.java')
-rw-r--r-- | src/com/android/settings/location/LocationSettings.java | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/com/android/settings/location/LocationSettings.java b/src/com/android/settings/location/LocationSettings.java index 8794a8dca..6eabf36da 100644 --- a/src/com/android/settings/location/LocationSettings.java +++ b/src/com/android/settings/location/LocationSettings.java @@ -53,7 +53,6 @@ public class LocationSettings extends LocationSettingsBase private static final String KEY_LOCATION_SERVICES = "location_services"; private SwitchBar mSwitchBar; - private Switch mSwitch; private boolean mValidListener; private Preference mLocationMode; private PreferenceCategory mCategoryRecentLocationRequests; @@ -72,7 +71,6 @@ public class LocationSettings extends LocationSettingsBase final SettingsActivity activity = (SettingsActivity) getActivity(); mSwitchBar = activity.getSwitchBar(); - mSwitch = mSwitchBar.getSwitch(); } @Override @@ -221,16 +219,16 @@ public class LocationSettings extends LocationSettingsBase // corner cases, the location might still be enabled. In such case the master switch should // be disabled but checked. boolean enabled = (mode != android.provider.Settings.Secure.LOCATION_MODE_OFF); - mSwitch.setEnabled(!restricted); + mSwitchBar.setSwitchEnabled(!restricted); mLocationMode.setEnabled(enabled && !restricted); mCategoryRecentLocationRequests.setEnabled(enabled); - if (enabled != mSwitch.isChecked()) { + if (enabled != mSwitchBar.isSwitchChecked()) { // set listener to null so that that code below doesn't trigger onCheckedChanged() if (mValidListener) { mSwitchBar.removeOnSwitchChangeListener(this); } - mSwitch.setChecked(enabled); + mSwitchBar.setSwitchChecked(enabled); if (mValidListener) { mSwitchBar.addOnSwitchChangeListener(this); } |