diff options
author | Steve Kondik <steve@cyngn.com> | 2016-11-07 16:50:48 -0800 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2016-11-09 00:32:48 -0800 |
commit | f549631a977d44b3cf378cf51de108ab022c7315 (patch) | |
tree | 56f691c6df6825e8302824e07ef8c9f8ec398e87 /src/com/android/camera/PhotoModule.java | |
parent | 594d0fc312f957f0e9a1d64f658520f699e09b50 (diff) | |
download | android_packages_apps_Snap-f549631a977d44b3cf378cf51de108ab022c7315.tar.gz android_packages_apps_Snap-f549631a977d44b3cf378cf51de108ab022c7315.tar.bz2 android_packages_apps_Snap-f549631a977d44b3cf378cf51de108ab022c7315.zip |
Reenable left swipe for Filmstrip
* These commits are from the CameraNext application in COS.
* Credits: Ed Carrigan, Ed Mancebo, Wilhelm Fitzpatrick
Revert "SnapdragonCamera: Fix preview broken when coming back from gallery"
This reverts commit 5b8948f83a65e8f9bd1b419bd11511e48dc34887.
Revert "SnapdragonCamera: fix crash after photo deletion"
This reverts commit 171d2b253a752ca104ccf4a58f4e9d6d82bd7b28.
CameraNext: Fix camera crash on device unlock
This patch from the plugin branch also fixes CYNGNOS-1878
Due to the bug below, when the camera is fore-grounded when device
is unlocked, the SurfaceView is getting recreated, which caused it
to be in a weird state when we were trying to reattach the preview
to it.
-----
Fixed Black Screen On Back.
The issue was that mCameraView was not being populated when it
should have been (after it had been added to the view hierarchy).
The problem was the SurfaceView was being removed from the hierarchy
when it shouldn't have been.
Issue-Id: CP-129
(cherry picked from commit 4010462fe0b4cf1c15624cfca7d6a3d4d380613a)
CameraNext: avoid scaling camera preview in filmstrip
(cherry picked from commit 823ed983c4dccac3959635f1a14fcfe47cd7b120)
CameraNext: fade camera preview to black during film strip transition
Instead of scaling and translating the camera preview to make room for film strip
images, we leave the preview in place and cover it gradually with the black preview
cover.
CameraNext : Add offset calculation for left navbar
Also prevent preview from translating while hidden - was
causing occasional glimpses of it in filmstrip.
CameraNext : Ensure vertical/horizontal swipes don't conflict
Ensure that the user can't swipe horizontally while trying
to delete the image. Avoids all sorts of synching issues between
mViewItem and the data adapter since the buffer is trying to constantly
keep its center to be the current visible item
CYNGNOS-1069
CameraNext: fix crash on entering filmstrip via thumbnail tap
mVerticalViewId was getting initialized in onUp, but if filmstrip
was entered without a swipe, no onUp occurred. Fixed by directly
initializing the field on object creation.
CameraNext: Fix ZoomView in the filmstrip
The ZoomView was getting covered in the Z axis while scrolling.
issue-id: SAMBAR-862
Revert "SnapdragonCamera: fix camera preview broken when resume from gallery"
This reverts commit 0acc1f027637c4f0126883be68f97817d7306032.
Change-Id: If4dd591c5c752a7fa33c669c15875c0077446a37
Diffstat (limited to 'src/com/android/camera/PhotoModule.java')
-rwxr-xr-x | src/com/android/camera/PhotoModule.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java index f07d132c7..5eff069ab 100755 --- a/src/com/android/camera/PhotoModule.java +++ b/src/com/android/camera/PhotoModule.java @@ -4152,6 +4152,9 @@ public class PhotoModule @TargetApi(Build.VERSION_CODES.JELLY_BEAN) private void updateAutoFocusMoveCallback() { + if (mCameraDevice == null) { + return; + } if (mParameters.getFocusMode().equals(CameraUtil.FOCUS_MODE_CONTINUOUS_PICTURE) || mParameters.getFocusMode().equals(CameraUtil.FOCUS_MODE_MW_CONTINUOUS_PICTURE)) { mCameraDevice.setAutoFocusMoveCallback(mHandler, @@ -4161,6 +4164,13 @@ public class PhotoModule } } + @TargetApi(Build.VERSION_CODES.JELLY_BEAN) + private void disableAutoFocusMoveCallback() { + if (mCameraDevice != null) { + mCameraDevice.setAutoFocusMoveCallback(null, null); + } + } + // We separate the parameters into several subsets, so we can update only // the subsets actually need updating. The PREFERENCE set needs extra // locking because the preference can be changed from GLThread as well. @@ -5008,6 +5018,26 @@ public class PhotoModule } } + @Override + public void showPreviewCover() { + disableAutoFocusMoveCallback(); + stopFaceDetection(); + mUI.getFocusRing().stopFocusAnimations(); + mUI.showPreviewCover(); + } + + @Override + public void hidePreviewCover() { + mUI.hidePreviewCover(); + startFaceDetection(); + updateAutoFocusMoveCallback(); + } + + @Override + public void setPreviewCoverAlpha(float alpha) { + mUI.setPreviewCoverAlpha(alpha); + } + public void onMakeupLevelSync(String key, String value) { Log.d(TAG, "PhotoModule.onMakeupLevel(): key is " + key + ", value is " + value); |