diff options
author | Doris Liu <tianliu@google.com> | 2013-08-31 00:34:33 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-08-31 00:34:34 +0000 |
commit | 0dff7ce1f701816b4a634b612bcaaaae6de0da34 (patch) | |
tree | d355064b4c6aa84725d4ba744a41c9c306859342 /src | |
parent | b2f0968c90a352cca43f508d216c3f28c3d2cc16 (diff) | |
parent | f9ddb6034e560684e4d3ddd460ef9dff345e4e91 (diff) | |
download | android_packages_apps_Snap-0dff7ce1f701816b4a634b612bcaaaae6de0da34.tar.gz android_packages_apps_Snap-0dff7ce1f701816b4a634b612bcaaaae6de0da34.tar.bz2 android_packages_apps_Snap-0dff7ce1f701816b4a634b612bcaaaae6de0da34.zip |
Merge "Reset zoom view when user exits app or rotate device" into gb-ub-photos-carlsbad
Diffstat (limited to 'src')
-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) { |