diff options
author | Steve Kondik <steve@cyngn.com> | 2016-11-07 21:33:39 -0800 |
---|---|---|
committer | Michael Bestas <mikeioannina@gmail.com> | 2017-01-04 22:00:39 +0200 |
commit | f4b0a07e3e9f7ab325660b0c8dca82eb392e8168 (patch) | |
tree | 0f961bb00792398bcff34a99f9cc85c704ba8e7b /src | |
parent | c3d5c2c58485fc0789af0e178dd11b881df0f63c (diff) | |
download | android_packages_apps_Snap-f4b0a07e3e9f7ab325660b0c8dca82eb392e8168.tar.gz android_packages_apps_Snap-f4b0a07e3e9f7ab325660b0c8dca82eb392e8168.tar.bz2 android_packages_apps_Snap-f4b0a07e3e9f7ab325660b0c8dca82eb392e8168.zip |
Revert "SnapdragonCamera: Remove swipe right to open menu"
* Swipe ALL the directions
This reverts commit 0321ab092671d680373bff35673fa6a069d7e57e.
Change-Id: I934475575fa5a65ef93a0b3813a1ffae365b0187
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/camera/PreviewGestures.java | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/src/com/android/camera/PreviewGestures.java b/src/com/android/camera/PreviewGestures.java index 7aa5fa84c..941516fbe 100644 --- a/src/com/android/camera/PreviewGestures.java +++ b/src/com/android/camera/PreviewGestures.java @@ -87,8 +87,29 @@ public class PreviewGestures return false; } if (mZoomOnly || mMode == MODE_ZOOM) return false; - - return onSingleTapUp(e2); + int deltaX = (int) (e1.getX() - e2.getX()); + int deltaY = (int) (e1.getY() - e2.getY()); + + int orientation = 0; + if (mPhotoMenu != null) + orientation = mPhotoMenu.getOrientation(); + else if (mVideoMenu != null) + orientation = mVideoMenu.getOrientation(); + else if (mCaptureUI != null) + orientation = mCaptureUI.getOrientation(); + + if (isLeftSwipe(orientation, deltaX, deltaY)) { + waitUntilNextDown = true; + if (mPhotoMenu != null && !mPhotoMenu.isMenuBeingShown()) + mPhotoMenu.openFirstLevel(); + else if (mVideoMenu != null && !mVideoMenu.isMenuBeingShown()) + mVideoMenu.openFirstLevel(); + else if (mCaptureUI != null && !mCaptureUI.isMenuBeingShown()) + mCaptureUI.showSettingMenu(); + return true; + } else { + return onSingleTapUp(e2); + } } private boolean isLeftSwipe(int orientation, int deltaX, int deltaY) { |