summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhuiyan <huiyan@codeaurora.org>2016-04-28 14:19:11 +0800
committerSteve Kondik <steve@cyngn.com>2016-09-26 04:54:49 -0700
commit2a9c5cd8742bb55a59920d6419fc72cafeddb682 (patch)
tree819a8e325b78e699d246ea062658dd0a12f2be29
parentc9726f4dfea15dfa303086c90650534c32f5f3ec (diff)
downloadandroid_packages_apps_Gallery2-2a9c5cd8742bb55a59920d6419fc72cafeddb682.tar.gz
android_packages_apps_Gallery2-2a9c5cd8742bb55a59920d6419fc72cafeddb682.tar.bz2
android_packages_apps_Gallery2-2a9c5cd8742bb55a59920d6419fc72cafeddb682.zip
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
-rwxr-xr-xsrc/com/android/gallery3d/app/PhotoPage.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java
index f53231f58..8f269174d 100755
--- a/src/com/android/gallery3d/app/PhotoPage.java
+++ b/src/com/android/gallery3d/app/PhotoPage.java
@@ -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);
- mCurrentIndex = data.getInt(KEY_INDEX_HINT, 0);
+ 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);
@@ -615,6 +621,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);
mPhotoView.setWantPictureCenterCallbacks(false);