summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/ui
diff options
context:
space:
mode:
authorAlan Newberger <alann@google.com>2014-09-22 12:30:08 -0700
committerAlan Newberger <alann@google.com>2014-09-22 17:08:27 -0700
commit5f86f7fdd19dad9cdf670e0504cfaddefd4a89fc (patch)
treee5d89d15ad7a58d8f6de059a8bf79e2d450204f4 /src/com/android/camera/ui
parentb2b0e02cb5f0aba8fed9389193fa98150da75efc (diff)
downloadandroid_packages_apps_Camera2-5f86f7fdd19dad9cdf670e0504cfaddefd4a89fc.tar.gz
android_packages_apps_Camera2-5f86f7fdd19dad9cdf670e0504cfaddefd4a89fc.tar.bz2
android_packages_apps_Camera2-5f86f7fdd19dad9cdf670e0504cfaddefd4a89fc.zip
Cleanup gesture UI hide code
Relocate show/hide of zoom UI in the onScaleBegin/onScaleEnd classes. Bug: 17613719 Change-Id: I400161c95c08c7f3b6b36487de703296236595bb
Diffstat (limited to 'src/com/android/camera/ui')
-rw-r--r--src/com/android/camera/ui/PreviewOverlay.java21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/com/android/camera/ui/PreviewOverlay.java b/src/com/android/camera/ui/PreviewOverlay.java
index ba0e697e1..3ccc7584c 100644
--- a/src/com/android/camera/ui/PreviewOverlay.java
+++ b/src/com/android/camera/ui/PreviewOverlay.java
@@ -198,15 +198,6 @@ public class PreviewOverlay extends View
if (ev.getPointerCount() > 1) {
mDeltaX = ev.getX(1) - ev.getX(0);
mDeltaY = ev.getY(1) - ev.getY(0);
- if (ev.getActionMasked() == MotionEvent.ACTION_POINTER_DOWN) {
- if (!mZoomProcessor.isVisible()) {
- mZoomProcessor.showZoomUI();
- }
- } else if (ev.getActionMasked() == MotionEvent.ACTION_POINTER_UP) {
- if (mZoomProcessor.isVisible()) {
- mZoomProcessor.hideZoomUI();
- }
- }
}
return handled;
}
@@ -309,8 +300,12 @@ public class PreviewOverlay extends View
public boolean onScale(ScaleGestureDetector detector) {
final float sf = detector.getScaleFactor();
mCurrentRatio = (0.33f + mCurrentRatio) * sf * sf - 0.33f;
- if (mCurrentRatio < mMinRatio) mCurrentRatio = mMinRatio;
- if (mCurrentRatio > mMaxRatio) mCurrentRatio = mMaxRatio;
+ if (mCurrentRatio < mMinRatio) {
+ mCurrentRatio = mMinRatio;
+ }
+ if (mCurrentRatio > mMaxRatio) {
+ mCurrentRatio = mMaxRatio;
+ }
// Only call the listener with a certain frequency. This is
// necessary because these listeners will make repeated
@@ -331,10 +326,10 @@ public class PreviewOverlay extends View
@Override
public boolean onScaleBegin(ScaleGestureDetector detector) {
+ mZoomProcessor.showZoomUI();
if (mZoomListener == null) {
return false;
}
- mVisible = true;
if (mZoomListener != null) {
mZoomListener.onZoomStart();
}
@@ -345,7 +340,7 @@ public class PreviewOverlay extends View
@Override
public void onScaleEnd(ScaleGestureDetector detector) {
- mVisible = false;
+ mZoomProcessor.hideZoomUI();
if (mZoomListener != null) {
mZoomListener.onZoomEnd();
}