diff options
author | Doris Liu <tianliu@google.com> | 2013-08-30 17:37:10 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-08-30 17:37:10 -0700 |
commit | 14f85082d9aba3819fd8f0f64bf5aaf28a2fbe9b (patch) | |
tree | 6b46078d96a85c60f1dbb5f547ef18c3fe59b1b6 | |
parent | 6e9cfebc56b703ba2057061ba9a9f192e645d437 (diff) | |
parent | 0dff7ce1f701816b4a634b612bcaaaae6de0da34 (diff) | |
download | android_packages_apps_Snap-14f85082d9aba3819fd8f0f64bf5aaf28a2fbe9b.tar.gz android_packages_apps_Snap-14f85082d9aba3819fd8f0f64bf5aaf28a2fbe9b.tar.bz2 android_packages_apps_Snap-14f85082d9aba3819fd8f0f64bf5aaf28a2fbe9b.zip |
am 0dff7ce1: Merge "Reset zoom view when user exits app or rotate device" into gb-ub-photos-carlsbad
* commit '0dff7ce1f701816b4a634b612bcaaaae6de0da34':
Reset zoom view when user exits app or rotate device
-rw-r--r-- | src/com/android/camera/ui/FilmStripView.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/com/android/camera/ui/FilmStripView.java b/src/com/android/camera/ui/FilmStripView.java index de57296bc..bc56333d2 100644 --- a/src/com/android/camera/ui/FilmStripView.java +++ b/src/com/android/camera/ui/FilmStripView.java @@ -566,6 +566,12 @@ public class FilmStripView extends ViewGroup implements BottomControlsListener { mView.setTranslationY(transY); } + void resetTransform() { + mView.setScaleX(FULL_SCREEN_SCALE); + mView.setScaleY(FULL_SCREEN_SCALE); + mView.setTranslationX(0f); + mView.setTranslationY(0f); + } } public FilmStripView(Context context) { @@ -1173,9 +1179,30 @@ public class FilmStripView extends ViewGroup implements BottomControlsListener { mDrawArea.right = r; mDrawArea.bottom = b; + resetZoomView(); layoutChildren(); } + /** + * Clears the translation and scale that has been set on the view, cancels any loading + * request for image partial decoding, and hides zoom view. + * This is needed for when there is a layout change (e.g. when users re-enter the app, + * or rotate the device, etc). + */ + private void resetZoomView() { + if (!mController.isZoomStarted()) { + return; + } + ViewItem current = mViewItem[mCurrentItem]; + if (current == null) { + return; + } + mScale = FULL_SCREEN_SCALE; + current.resetTransform(); + mController.cancelLoadingZoomedImage(); + mZoomView.setVisibility(GONE); + } + // Keeps the view in the view hierarchy if it's camera preview. // Remove from the hierarchy otherwise. private void checkForRemoval(ImageData data, View v) { |