diff options
author | Paul Rohde <codelogic@google.com> | 2014-12-05 12:17:15 -0800 |
---|---|---|
committer | Michael Bestas <mkbestas@lineageos.org> | 2019-11-09 22:15:24 +0200 |
commit | ae159942ae27f5798051851160b9bae652f5a118 (patch) | |
tree | f2209f9284653a277eaff160c7a60e72c50998a6 /src/com/android/camera/VideoUI.java | |
parent | 70e618bdd825eb8b088d66feeefc0a7f0b06c7ed (diff) | |
download | android_packages_apps_Snap-ae159942ae27f5798051851160b9bae652f5a118.tar.gz android_packages_apps_Snap-ae159942ae27f5798051851160b9bae652f5a118.tar.bz2 android_packages_apps_Snap-ae159942ae27f5798051851160b9bae652f5a118.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/VideoUI.java')
-rwxr-xr-x | src/com/android/camera/VideoUI.java | 49 |
1 files changed, 5 insertions, 44 deletions
diff --git a/src/com/android/camera/VideoUI.java b/src/com/android/camera/VideoUI.java index 3e24f8510..66e73c60b 100755 --- a/src/com/android/camera/VideoUI.java +++ b/src/com/android/camera/VideoUI.java @@ -48,7 +48,6 @@ import android.view.View.OnLayoutChangeListener; import com.android.camera.CameraManager.CameraProxy; import com.android.camera.CameraPreference.OnPreferenceChangedListener; -import com.android.camera.FocusOverlayManager.FocusUI; import com.android.camera.PhotoUI.SurfaceTextureSizeChangedListener; import com.android.camera.ui.AbstractSettingPopup; import com.android.camera.ui.CameraControls; @@ -63,17 +62,18 @@ import com.android.camera.ui.RotateImageView; import com.android.camera.ui.RotateLayout; import com.android.camera.ui.RotateTextToast; import com.android.camera.ui.ZoomRenderer; +import com.android.camera.ui.focus.FocusRing; import com.android.camera.util.CameraUtil; public class VideoUI implements PieRenderer.PieListener, PreviewGestures.SingleTapListener, CameraRootView.MyDisplayListener, - FocusUI, SurfaceHolder.Callback, PauseButton.OnPauseButtonListener, CameraManager.CameraFaceDetectionCallback{ private static final String TAG = "CAM_VideoUI"; // module fields + private final FocusRing mFocusRing; private CameraActivity mActivity; private View mRootView; private SurfaceHolder mSurfaceHolder; @@ -246,6 +246,7 @@ public class VideoUI implements PieRenderer.PieListener, } }); + mFocusRing = (FocusRing) mRootView.findViewById(R.id.focus_ring); mFlashOverlay = mRootView.findViewById(R.id.flash_overlay); mShutterButton = (ShutterButton) mRootView.findViewById(R.id.shutter_button); mSwitcher = (ModuleSwitcher) mRootView.findViewById(R.id.camera_switcher); @@ -1241,14 +1242,6 @@ public class VideoUI implements PieRenderer.PieListener, mFaceView.setFaces(faces); } - public void pauseFaceDetection() { - if (mFaceView != null) mFaceView.pause(); - } - - public void resumeFaceDetection() { - if (mFaceView != null) mFaceView.resume(); - } - public void onStartFaceDetection(int orientation, boolean mirror) { mFaceView.setBlockDraw(false); mFaceView.clear(); @@ -1265,39 +1258,7 @@ public class VideoUI implements PieRenderer.PieListener, } } - // implement focusUI interface - private FocusIndicator getFocusIndicator() { - return mPieRenderer; - } - - @Override - public boolean hasFaces() { - return false; - } - - @Override - public void clearFocus() { - FocusIndicator indicator = getFocusIndicator(); - if (indicator != null) indicator.clear(); - } - - @Override - public void setFocusPosition(int x, int y) { - mPieRenderer.setFocus(x, y); - } - - @Override - public void onFocusStarted(){ - getFocusIndicator().showStart(); - } - - @Override - public void onFocusSucceeded(boolean timeOut) { - getFocusIndicator().showSuccess(timeOut); - } - - @Override - public void onFocusFailed(boolean timeOut) { - getFocusIndicator().showFail(timeOut); + public FocusRing getFocusRing() { + return mFocusRing; } } |