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

Unverified Commit bea587db authored by huiyan's avatar huiyan Committed by Michael Bestas
Browse files

Gallery2: Fix picture is different when changes font size

when change the system font size, photopage destroy. when re-start it,
the photopage restore from stack. But the current photo index is not saved.
So photopage display the original photo not the current photo.

In onSaveState the current photo index is saved. In onCreate that current
index is restored if the photopage restore from stack.

Change-Id: I9a0e4ff1d13773a976c197e96fef570c173b3b8d
CRs-Fixed: 1004545
parent bd7fe906
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -407,7 +407,13 @@ public abstract class PhotoPage extends ActivityState implements
        mIsFromWidget = data.getBoolean(KEY_IS_FROM_WIDGET, false);
        mStartInFilmstrip = data.getBoolean(KEY_START_IN_FILMSTRIP, false);
        boolean inCameraRoll = data.getBoolean(KEY_IN_CAMERA_ROLL, false);
        if (restoreState == null || mSetPathString == null) {
            mCurrentIndex = data.getInt(KEY_INDEX_HINT, 0);
        } else {
            mCurrentIndex = restoreState.getInt(KEY_INDEX_HINT, 0);
            //we only save index in onSaveState, set itemPath to null to get the right path later
            itemPath = null;
        }
        if (mSetPathString != null) {
            mShowSpinner = true;
            mAppBridge = (AppBridge) data.getParcelable(KEY_APP_BRIDGE);
@@ -614,6 +620,12 @@ public abstract class PhotoPage extends ActivityState implements
                });
    }

    @Override
    protected void onSaveState(Bundle outState) {
        outState.putInt(KEY_INDEX_HINT,mCurrentIndex);
        super.onSaveState(outState);
    }

    @Override
    public void onPictureCenter(boolean isCamera) {
        isCamera = isCamera || (mHasCameraScreennailOrPlaceholder && mAppBridge == null);