From 2502909a6ca3d259ec453530de69547ebc66fb31 Mon Sep 17 00:00:00 2001 From: Mattia Iavarone Date: Sun, 6 Aug 2017 18:15:07 +0200 Subject: [PATCH] Nits --- README.md | 3 ++- camerakit/src/main/api16/com/flurgle/camerakit/Camera1.java | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9b7e2c04..c82e9f0c 100644 --- a/README.md +++ b/README.md @@ -404,8 +404,9 @@ These are things that need to be done, off the top of my head: - [x] better threading, for example ensure callbacks are called in the ui thread - [x] pinch to zoom support - [ ] exposure correction APIs -- [ ] add a `sizingMethod` API to choose the capture size? Could be `max`, `4:3`, `16:9`... Right now it's `max` - [ ] `Camera2` integration +- [ ] check onPause / onStop / onSaveInstanceState consistency +- [ ] add a `setPreferredAspectRatio` API to choose the capture size. Preview size will adapt, and then, if let free, the CameraView will adapt as well - [ ] animate grid lines similar to stock camera app - [ ] add onRequestPermissionResults for easy permission callback - [ ] better error handling, maybe with a onError(e) method in the public listener, or have each public method return a boolean diff --git a/camerakit/src/main/api16/com/flurgle/camerakit/Camera1.java b/camerakit/src/main/api16/com/flurgle/camerakit/Camera1.java index b58b0246..55bb77eb 100644 --- a/camerakit/src/main/api16/com/flurgle/camerakit/Camera1.java +++ b/camerakit/src/main/api16/com/flurgle/camerakit/Camera1.java @@ -682,13 +682,14 @@ class Camera1 extends CameraController { List meteringAreas1 = meteringAreas2.subList(0, 1); synchronized (mLock) { Camera.Parameters params = mCamera.getParameters(); - boolean autofocusSupported = params.getSupportedFocusModes().contains(Camera.Parameters.FOCUS_MODE_AUTO); + // TODO remove this check once CameraView.setFocus TODO is fixed. + boolean autofocusSupported = mOptions.getSupportedFocus().contains(CameraConstants.FOCUS_TAP); if (autofocusSupported) { int maxAF = params.getMaxNumFocusAreas(); int maxAE = params.getMaxNumMeteringAreas(); if (maxAF > 0) params.setFocusAreas(maxAF > 1 ? meteringAreas2 : meteringAreas1); if (maxAE > 0) params.setMeteringAreas(maxAE > 1 ? meteringAreas2 : meteringAreas1); - params.setFocusMode(Camera.Parameters.FOCUS_MODE_AUTO); + params.setFocusMode((String) mMapper.mapFocus(FOCUS_TAP)); // auto mCamera.setParameters(params); mCameraCallbacks.dispatchOnFocusStart(x, y); mCamera.autoFocus(new Camera.AutoFocusCallback() {