Make the SwitchBar appear immediately
- change the way the SwitchBar is shown and hidden - save its state - remove the delay transition code Change-Id: I07260430e6709b42517ca011f6d3c3446a626731
This commit is contained in:
@@ -73,6 +73,16 @@ public class LocationSettings extends LocationSettingsBase
|
||||
|
||||
mSwitchBar = activity.getSwitchBar();
|
||||
mSwitch = mSwitchBar.getSwitch();
|
||||
mSwitchBar.addOnSwitchChangeListener(this);
|
||||
mSwitchBar.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
|
||||
mSwitchBar.removeOnSwitchChangeListener(this);
|
||||
mSwitchBar.hide();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -84,8 +94,6 @@ public class LocationSettings extends LocationSettingsBase
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
createPreferenceHierarchy();
|
||||
mSwitchBar.addOnSwitchChangeListener(this);
|
||||
mSwitchBar.show();
|
||||
mValidListener = true;
|
||||
}
|
||||
|
||||
@@ -97,8 +105,6 @@ public class LocationSettings extends LocationSettingsBase
|
||||
// Ignore exceptions caused by race condition
|
||||
}
|
||||
super.onPause();
|
||||
mSwitchBar.removeOnSwitchChangeListener(this);
|
||||
mSwitchBar.hide();
|
||||
mValidListener = false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user