diff options
author | Paul Rohde <codelogic@google.com> | 2014-12-05 12:17:15 -0800 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-01-15 10:01:23 -0800 |
commit | d8420e3702c5504e45a51fd29642167b4ab66312 (patch) | |
tree | 6aaebf6a1982a8897966821edc86efb004b079ae /src/com/android/camera/PhotoModule.java | |
parent | db2718622223b230618e9dae5b0c5d2eb4e68741 (diff) | |
download | android_packages_apps_Snap-d8420e3702c5504e45a51fd29642167b4ab66312.tar.gz android_packages_apps_Snap-d8420e3702c5504e45a51fd29642167b4ab66312.tar.bz2 android_packages_apps_Snap-d8420e3702c5504e45a51fd29642167b4ab66312.zip |
Drop new focus indicator into Camera2.
* Create a new custom focus view that interacts with physical lens diopter changes.
* Replace all occurances of the old focus indicator with the new one.
Change-Id: Ia02646ce4d1eb059ecb8a1dfccc15dfc9c167e1b
Diffstat (limited to 'src/com/android/camera/PhotoModule.java')
-rw-r--r-- | src/com/android/camera/PhotoModule.java | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java index f92ef65ba..53468eb7f 100644 --- a/src/com/android/camera/PhotoModule.java +++ b/src/com/android/camera/PhotoModule.java @@ -624,7 +624,7 @@ public class PhotoModule Log.v(TAG, "onCameraOpened"); openCameraCommon(); resizeForPreviewAspectRatio(); - updateFocusManager(mUI); + mFocusManager.setFocusRing(mUI.getFocusRing()); } private void switchCamera() { @@ -655,7 +655,6 @@ public class PhotoModule } closeCamera(); mUI.collapseCameraControls(); - mUI.clearFaces(); if (mFocusManager != null) mFocusManager.removeMessages(); // Restart the camera and initialize the UI. From onCreate. @@ -927,7 +926,6 @@ public class PhotoModule if (mParameters.getMaxNumDetectedFaces() > 0) { mFaceDetectionStarted = false; mCameraDevice.setFaceDetectionCallback(null, null); - mUI.pauseFaceDetection(); mCameraDevice.stopFaceDetection(); mUI.onStopFaceDetection(); } @@ -1133,8 +1131,6 @@ public class PhotoModule return; } - mFocusManager.updateFocusUI(); // Ensure focus indicator is hidden. - String jpegFilePath = new String(jpegData); mNamedImages.nameNewImage(mCaptureStartTime); NamedEntity name = mNamedImages.getNextNameEntity(); @@ -1230,8 +1226,6 @@ public class PhotoModule Log.v(TAG, "mPictureDisplayedToJpegCallbackTime = " + mPictureDisplayedToJpegCallbackTime + "ms"); - mFocusManager.updateFocusUI(); // Ensure focus indicator is hidden. - if (isLongshotDone()) { mCameraDevice.setLongshot(false); } @@ -1278,7 +1272,6 @@ public class PhotoModule || CameraUtil.FOCUS_MODE_MW_CONTINUOUS_PICTURE.equals(mFocusManager.getFocusMode())) { mCameraDevice.cancelAutoFocus(); } - mUI.resumeFaceDetection(); if (!mIsImageCaptureIntent) { setCameraState(IDLE); } @@ -2434,22 +2427,12 @@ public class PhotoModule if (mFocusManager == null) { mFocusManager = new FocusOverlayManager(mPreferences, defaultFocusModes, mInitialParams, this, mMirror, - mActivity.getMainLooper(), mUI); + mActivity.getMainLooper(), mUI != null ? mUI.getFocusRing() : null); } } } } - private void updateFocusManager(PhotoUI mUI) { - // Idea here is to let focus manager create in camera open thread - // (in initializeFocusManager) even if photoUI is null by that time so - // as to not block start preview process. Once UI creation is done, - // we will update focus manager with proper UI. - if (mFocusManager != null && mUI != null) { - mFocusManager.setPhotoUI(mUI); - } - } - @Override public void onConfigurationChanged(Configuration newConfig) { Log.v(TAG, "onConfigurationChanged"); |