summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorSteve Kondik <steve@cyngn.com>2016-11-07 21:33:39 -0800
committerSteve Kondik <steve@cyngn.com>2016-11-09 00:33:21 -0800
commit07bf07444dda71b7e6c6b7e8e36c460ff17a15fa (patch)
treebc04d3bbde77196efd24a998b2fb09e9fd809954 /src/com
parent5a82864e7cf42d3bd04bb167ebfa52d3e5deb1f6 (diff)
downloadandroid_packages_apps_Snap-07bf07444dda71b7e6c6b7e8e36c460ff17a15fa.tar.gz
android_packages_apps_Snap-07bf07444dda71b7e6c6b7e8e36c460ff17a15fa.tar.bz2
android_packages_apps_Snap-07bf07444dda71b7e6c6b7e8e36c460ff17a15fa.zip
Revert "SnapdragonCamera: Remove swipe right to open menu"
* Swipe ALL the directions This reverts commit 0321ab092671d680373bff35673fa6a069d7e57e. Change-Id: I934475575fa5a65ef93a0b3813a1ffae365b0187
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/camera/PreviewGestures.java25
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) {