Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c3b2165d authored by Daniel Norman's avatar Daniel Norman
Browse files

Update A11ySettings to load preferences in onCreate().

This version still only loads preferences once, but the previous attempt
commit 774bbc1f
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
parent 8f93b4d7
Loading
Loading
Loading
Loading
+13 −6
Original line number Diff line number Diff line
@@ -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
+1 −0
Original line number Diff line number Diff line
@@ -385,6 +385,7 @@ public class AccessibilitySettingsTest {

        mFragment.onContentChanged();
        mFragment.onStart();
        mFragment.onResume();

        RestrictedPreference preference = mFragment.getPreferenceScreen().findPreference(
                COMPONENT_NAME.flattenToString());