diff options
author | Chih-Chung Chang <chihchung@google.com> | 2012-05-30 17:10:32 -0700 |
---|---|---|
committer | Chih-Chung Chang <chihchung@google.com> | 2012-05-30 17:10:55 -0700 |
commit | 94fd2f9fa2bac08bc6da084d24243e679d44ea78 (patch) | |
tree | 4a1e065b101dc430001b7b9685a15dc5f0485e46 | |
parent | d416516856065b7b652b71700853b02d93376327 (diff) | |
download | android_packages_apps_Snap-94fd2f9fa2bac08bc6da084d24243e679d44ea78.tar.gz android_packages_apps_Snap-94fd2f9fa2bac08bc6da084d24243e679d44ea78.tar.bz2 android_packages_apps_Snap-94fd2f9fa2bac08bc6da084d24243e679d44ea78.zip |
If the focused box was at minimal scale, we try to make it the
minimal scale under the new view size.
Bug: 6584425
Change-Id: I7dcc748cb3659a06f2ca4d8550d075fdda2949fa
-rw-r--r-- | src/com/android/gallery3d/ui/PositionController.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/ui/PositionController.java b/src/com/android/gallery3d/ui/PositionController.java index ae0df34b5..b6737226b 100644 --- a/src/com/android/gallery3d/ui/PositionController.java +++ b/src/com/android/gallery3d/ui/PositionController.java @@ -200,6 +200,8 @@ class PositionController { public void setViewSize(int viewW, int viewH) { if (viewW == mViewW && viewH == mViewH) return; + boolean wasMinimal = isAtMinimalScale(); + mViewW = viewW; mViewH = viewH; initPlatform(); @@ -210,6 +212,13 @@ class PositionController { updateScaleAndGapLimit(); + // If the focused box was at minimal scale, we try to make it the + // minimal scale under the new view size. + if (wasMinimal) { + Box b = mBoxes.get(0); + b.mCurrentScale = b.mScaleMin; + } + // If we have the opening animation, do it. Otherwise go directly to the // right position. if (!startOpeningAnimationIfNeeded()) { |