summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d
diff options
context:
space:
mode:
authorhuiyan <huiyan@codeaurora.org>2016-04-28 14:19:11 +0800
committerGerrit - the friendly Code Review server <code-review@localhost>2016-05-02 22:47:43 -0700
commite0e82563de27293c79995d5709a8b3f795945b2f (patch)
treec8d1a6ec2f031f354b67a26bb2cbe1333803659c /src/com/android/gallery3d
parentb04211110dce21e7c898352313f0416f6e2ac9d9 (diff)
downloadandroid_packages_apps_Gallery2-e0e82563de27293c79995d5709a8b3f795945b2f.tar.gz
android_packages_apps_Gallery2-e0e82563de27293c79995d5709a8b3f795945b2f.tar.bz2
android_packages_apps_Gallery2-e0e82563de27293c79995d5709a8b3f795945b2f.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
Diffstat (limited to 'src/com/android/gallery3d')
-rw-r--r--src/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 9f7a054d8..287df66b7 100644
--- a/src/com/android/gallery3d/app/PhotoPage.java
+++ b/src/com/android/gallery3d/app/PhotoPage.java
@@ -425,7 +425,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);
@@ -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);
mPhotoView.setWantPictureCenterCallbacks(false);