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

Commit 8f1d5a14 authored by Peter Liang's avatar Peter Liang
Browse files

Fix that the preview should keep the same layer when switching the screen on/off.

Action:
Move the restore state action to the previous cycle.

Bug: 259213786
Test: manual test
Change-Id: Iff49d3774824e7cfe3912a4d18fd535083cf923a
parent 2c7f06e9
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -67,7 +67,6 @@ public class TextReadingPreferenceFragment extends DashboardFragment {

    private FontWeightAdjustmentPreferenceController mFontWeightAdjustmentController;
    private TextReadingPreviewController mPreviewController;
    private int mLastPreviewIndex = UNKNOWN_INDEX;
    private int mEntryPoint = EntryPoint.UNKNOWN_ENTRY;

    /**
@@ -110,7 +109,10 @@ public class TextReadingPreferenceFragment extends DashboardFragment {
            }

            if (savedInstanceState.containsKey(LAST_PREVIEW_INDEX)) {
                mLastPreviewIndex = savedInstanceState.getInt(LAST_PREVIEW_INDEX);
                final int lastPreviewIndex = savedInstanceState.getInt(LAST_PREVIEW_INDEX);
                if (lastPreviewIndex != UNKNOWN_INDEX) {
                    mPreviewController.setCurrentItem(lastPreviewIndex);
                }
            }
        }
    }
@@ -220,10 +222,6 @@ public class TextReadingPreferenceFragment extends DashboardFragment {
    @Override
    public void onStart() {
        super.onStart();

        if (mLastPreviewIndex != UNKNOWN_INDEX) {
            mPreviewController.setCurrentItem(mLastPreviewIndex);
        }
    }

    protected boolean isCallingFromAnythingElseEntryPoint() {