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 | f3f90752ca92372d61ca0ec22a9846261cfbcbde (patch) | |
| tree | c2bea3366cfc5a9b95ae1df7487649978bd724f0 /src | |
| parent | 42e1fed4edd9ed1e326aab2f7969242c56812952 (diff) | |
| download | android_packages_apps_Gallery2-f3f90752ca92372d61ca0ec22a9846261cfbcbde.tar.gz android_packages_apps_Gallery2-f3f90752ca92372d61ca0ec22a9846261cfbcbde.tar.bz2 android_packages_apps_Gallery2-f3f90752ca92372d61ca0ec22a9846261cfbcbde.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
Diffstat (limited to 'src')
| -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()) { |
