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:
Daniel Norman
2024-05-31 20:54:55 +00:00
parent 8f93b4d789
commit c3b2165dfe
2 changed files with 14 additions and 6 deletions

View File

@@ -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