Update A11ySettings to load preferences in onCreate().
This version still only loads preferences once, but the previous attempt
commit 774bbc1ff2
created a "sliding" effect as the preferences were loaded after the page
became visible to the user.
Also reorders methods so that their position in the source file matches
the Activity lifecycle ordering.
Bug: 327052480
Test: existing A11y Settings robotest presubmit
Test: Launch this page from the Settings app, observe no sliding UI
Flag: NONE low risk visual bug fix
Change-Id: I44312ada359aef7dec8eb27c57cde2a8e00f254b
This commit is contained in:
@@ -210,24 +210,31 @@ public class AccessibilitySettings extends DashboardFragment implements
|
||||
public void onCreate(Bundle icicle) {
|
||||
super.onCreate(icicle);
|
||||
initializeAllPreferences();
|
||||
updateAllPreferences();
|
||||
mNeedPreferencesUpdate = false;
|
||||
registerContentMonitors();
|
||||
registerInputDeviceListener();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
updateAllPreferences();
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
mIsForeground = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
if (mNeedPreferencesUpdate) {
|
||||
updateAllPreferences();
|
||||
mNeedPreferencesUpdate = false;
|
||||
}
|
||||
mIsForeground = true;
|
||||
super.onStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
mNeedPreferencesUpdate = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -385,6 +385,7 @@ public class AccessibilitySettingsTest {
|
||||
|
||||
mFragment.onContentChanged();
|
||||
mFragment.onStart();
|
||||
mFragment.onResume();
|
||||
|
||||
RestrictedPreference preference = mFragment.getPreferenceScreen().findPreference(
|
||||
COMPONENT_NAME.flattenToString());
|
||||
|
Reference in New Issue
Block a user