diff options
author | Byunghun Jeon <bjeon@codeaurora.org> | 2015-11-17 14:20:30 -0800 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2016-08-25 21:55:20 -0700 |
commit | 075630e6a853d472cb35e31cb7454596da1bfa0b (patch) | |
tree | 42df9f8a368c216c6ef4923a2ec8f9af43f0fb4f /src/com/android/camera/PreviewGestures.java | |
parent | 39b3dfdfc54fdcdf2ca8a65c4351043b9bb0f9d1 (diff) | |
download | android_packages_apps_Snap-075630e6a853d472cb35e31cb7454596da1bfa0b.tar.gz android_packages_apps_Snap-075630e6a853d472cb35e31cb7454596da1bfa0b.tar.bz2 android_packages_apps_Snap-075630e6a853d472cb35e31cb7454596da1bfa0b.zip |
SnapdragonCamera: Add Camera2 mode
Use camera2 API to show preview and take snapshot
CRs-Fixed: 989750
Change-Id: I07e2d6743529b3d3d5acecf667e9493465a094c9
Diffstat (limited to 'src/com/android/camera/PreviewGestures.java')
-rw-r--r-- | src/com/android/camera/PreviewGestures.java | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/src/com/android/camera/PreviewGestures.java b/src/com/android/camera/PreviewGestures.java index 913dd1e3c..f4262bade 100644 --- a/src/com/android/camera/PreviewGestures.java +++ b/src/com/android/camera/PreviewGestures.java @@ -20,9 +20,8 @@ import android.view.GestureDetector; import android.view.MotionEvent; import android.view.ScaleGestureDetector; import android.view.View; +import android.util.Log; -import com.android.camera.PhotoMenu; -import com.android.camera.VideoMenu; import com.android.camera.ui.PieRenderer; import com.android.camera.ui.RenderOverlay; import com.android.camera.ui.ZoomRenderer; @@ -56,6 +55,7 @@ public class PreviewGestures private boolean mEnabled; private boolean mZoomOnly; private GestureDetector mGestureDetector; + private CaptureMenu mCaptureMenu; private PhotoMenu mPhotoMenu; private VideoMenu mVideoMenu; private boolean waitUntilNextDown; @@ -95,6 +95,8 @@ public class PreviewGestures orientation = mPhotoMenu.getOrientation(); else if (mVideoMenu != null) orientation = mVideoMenu.getOrientation(); + else if (mCaptureMenu != null) + orientation = mCaptureMenu.getOrientation(); if (isSwipeForMenu(orientation, deltaX, deltaY)) { waitUntilNextDown = true; @@ -102,6 +104,8 @@ public class PreviewGestures mPhotoMenu.openFirstLevel(); else if (mVideoMenu != null && !mVideoMenu.isMenuBeingShown()) mVideoMenu.openFirstLevel(); + else if (mCaptureMenu != null && !mCaptureMenu.isMenuBeingShown()) + mCaptureMenu.openFirstLevel(); return true; } return false; @@ -165,6 +169,10 @@ public class PreviewGestures return mEnabled; } + public void setCaptureMenu(CaptureMenu menu) { + mCaptureMenu = menu; + } + public void setPhotoMenu(PhotoMenu menu) { mPhotoMenu = menu; } @@ -173,6 +181,10 @@ public class PreviewGestures mVideoMenu = menu; } + public CaptureMenu getCaptureMenu() { + return mCaptureMenu; + } + public PhotoMenu getPhotoMenu() { return mPhotoMenu; } @@ -209,6 +221,20 @@ public class PreviewGestures return sendToPie(m); } + if (mCaptureMenu != null) { + if (mCaptureMenu.isMenuBeingShown()) { + if (!mCaptureMenu.isMenuBeingAnimated()) { + waitUntilNextDown = true; + mCaptureMenu.closeView(); + } + return true; + } + if (mCaptureMenu.isPreviewMenuBeingShown()) { + waitUntilNextDown = true; + return true; + } + } + if (mPhotoMenu != null) { if (mPhotoMenu.isMenuBeingShown()) { if (!mPhotoMenu.isMenuBeingAnimated()) { |