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:
@@ -142,27 +142,30 @@ public class CaptionPropertiesFragment extends SettingsPreferenceFragment
|
||||
refreshPreviewText();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
|
||||
final boolean enabled = mCaptioningManager.isEnabled();
|
||||
SettingsActivity activity = (SettingsActivity) getActivity();
|
||||
mSwitchBar = activity.getSwitchBar();
|
||||
mSwitchBar.setTextViewLabel(enabled);
|
||||
mToggleSwitch = mSwitchBar.getSwitch();
|
||||
mToggleSwitch.setCheckedInternal(enabled);
|
||||
|
||||
getPreferenceScreen().setEnabled(enabled);
|
||||
|
||||
refreshPreviewText();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
installSwitchBarToggleSwitch();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
removeSwitchBarToggleSwitch();
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
private void refreshPreviewText() {
|
||||
|
Reference in New Issue
Block a user