diff options
-rw-r--r-- | res/layout/camera.xml | 5 | ||||
-rw-r--r-- | res/values/colors.xml | 2 | ||||
-rw-r--r-- | res/values/dimens.xml | 2 | ||||
-rw-r--r-- | src/com/android/camera/CaptureModule.java | 6 | ||||
-rw-r--r-- | src/com/android/camera/PhotoUI.java | 9 | ||||
-rw-r--r-- | src/com/android/camera/debug/DebugPropertyHelper.java | 24 | ||||
-rw-r--r-- | src/com/android/camera/one/v2/OneCameraImpl.java | 2 | ||||
-rw-r--r-- | src/com/android/camera/ui/FaceView.java | 2 |
8 files changed, 32 insertions, 20 deletions
diff --git a/res/layout/camera.xml b/res/layout/camera.xml index 25236473f..cda57e810 100644 --- a/res/layout/camera.xml +++ b/res/layout/camera.xml @@ -42,6 +42,11 @@ android:layout_width="match_parent" android:layout_height="match_parent" /> + <com.android.camera.ui.FaceView + android:id="@+id/face_view" + android:layout_width="match_parent" + android:layout_height="match_parent" /> + <com.android.camera.ui.GridLines android:id="@+id/grid_lines" android:layout_width="match_parent" diff --git a/res/values/colors.xml b/res/values/colors.xml index a8ee96b61..8b6ee22b5 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -65,7 +65,7 @@ <color name="holo_blue_light">#ff33b5e5</color> <color name="bright_foreground_disabled_holo_dark">#ff4c4c4c</color> <color name="bright_foreground_holo_dark">#fff3f3f3</color> - <color name="face_detect_start">#80ffffff</color> + <color name="face_detect_start">#ffffff00</color> <color name="face_detect_success">#8050d060</color> <color name="face_detect_fail">#80d05060</color> <color name="gray">#FFAAAAAA</color> diff --git a/res/values/dimens.xml b/res/values/dimens.xml index 31e855063..19c0e8ac6 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -92,7 +92,7 @@ <dimen name="focus_outer_stroke">3dp</dimen> <dimen name="focus_inner_stroke">2dp</dimen> <dimen name="switcher_size">72dp</dimen> - <dimen name="face_circle_stroke">2dip</dimen> + <dimen name="face_circle_stroke">1dip</dimen> <dimen name="shutter_offset">-22dp</dimen> <dimen name="size_thumbnail">200dip</dimen> <dimen name="size_preview">400dip</dimen> diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java index 0b2fb1877..da850adb0 100644 --- a/src/com/android/camera/CaptureModule.java +++ b/src/com/android/camera/CaptureModule.java @@ -150,7 +150,7 @@ public class CaptureModule extends CameraModule private static final int ON_RESUME_TASKS_DELAY_MSEC = 20; /** System Properties switch to enable debugging focus UI. */ - private static final boolean FOCUS_DEBUG_UI = DebugPropertyHelper.showFocusDebugUI(); + private static final boolean CAPTURE_DEBUG_UI = DebugPropertyHelper.showCaptureDebugUI(); private final Object mDimensionLock = new Object(); @@ -660,7 +660,7 @@ public class CaptureModule extends CameraModule public void onFocusStatusUpdate(final AutoFocusMode mode, final AutoFocusState state) { Log.v(TAG, "AF status is mode:" + mode + " state:" + state); - if (FOCUS_DEBUG_UI) { + if (CAPTURE_DEBUG_UI) { // TODO: Add debug circle radius+color UI to FocusOverlay. // mMainHandler.post(...) } @@ -668,7 +668,7 @@ public class CaptureModule extends CameraModule // If mTapToFocusInProgress, clear UI. if (mTapToFocusInProgress) { // Clear UI on return to CONTINUOUS_PICTURE (debug mode). - if (FOCUS_DEBUG_UI) { + if (CAPTURE_DEBUG_UI) { if (mode == AutoFocusMode.CONTINUOUS_PICTURE) { mTapToFocusInProgress = false; mMainHandler.removeCallbacks(mHideAutoFocusTargetRunnable); diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java index 4d609a9b7..70699a7ed 100644 --- a/src/com/android/camera/PhotoUI.java +++ b/src/com/android/camera/PhotoUI.java @@ -33,6 +33,7 @@ import android.widget.FrameLayout; import android.widget.ImageView; import com.android.camera.FocusOverlayManager.FocusUI; +import com.android.camera.debug.DebugPropertyHelper; import com.android.camera.debug.Log; import com.android.camera.ui.CountDownView; import com.android.camera.ui.FaceView; @@ -65,7 +66,7 @@ public class PhotoUI implements PreviewStatusListener, private Dialog mDialog = null; // TODO: Remove face view logic if UX does not bring it back within a month. - private final FaceView mFaceView = null; + private final FaceView mFaceView; private DecodeImageForReview mDecodeTaskForReview = null; private float mZoomMax; @@ -234,6 +235,12 @@ public class PhotoUI implements PreviewStatusListener, mFocusUI = (FocusUI) mRootView.findViewById(R.id.focus_overlay); mPreviewOverlay = (PreviewOverlay) mRootView.findViewById(R.id.preview_overlay); mCountdownView = (CountDownView) mRootView.findViewById(R.id.count_down_view); + // Show faces if we are in debug mode. + if (DebugPropertyHelper.showCaptureDebugUI()) { + mFaceView = (FaceView) mRootView.findViewById(R.id.face_view); + } else { + mFaceView = null; + } if (mController.isImageCaptureIntent()) { initIntentReviewImageView(); diff --git a/src/com/android/camera/debug/DebugPropertyHelper.java b/src/com/android/camera/debug/DebugPropertyHelper.java index 122738f21..0500f5e1c 100644 --- a/src/com/android/camera/debug/DebugPropertyHelper.java +++ b/src/com/android/camera/debug/DebugPropertyHelper.java @@ -29,10 +29,14 @@ public class DebugPropertyHelper { /** Switch between PhotoModule and the new CaptureModule. */ private static final String PROP_ENABLE_CAPTURE_MODULE = PREFIX + ".newcapture"; - /** Enable additional focus logging. */ - private static final String PROP_FOCUS_DEBUG_LOG = PREFIX + ".frame_log"; - /** Enable additional debug UI to show AE, AF, Face detection states */ - private static final String PROP_3A_DEBUG_UI = PREFIX + ".debug_ui"; + /** Enable frame-by-frame focus logging. */ + private static final String PROP_FRAME_LOG = PREFIX + ".frame_log"; + /** + * Enable additional capture debug UI. + * For API1/Photomodule: show faces. + * For API2/Capturemodule: show faces, AF state, AE/AF precise regions. + */ + private static final String PROP_CAPTURE_DEBUG_UI = PREFIX + ".debug_ui"; /** Write data about each capture request to disk. */ private static final String PROP_WRITE_CAPTURE_DATA = PREFIX + ".capture_write"; @@ -44,16 +48,12 @@ public class DebugPropertyHelper { return ALL_3A_DEBUG_ON || isPropertyOn(PROP_ENABLE_CAPTURE_MODULE); } - public static boolean showFocusDebugLog() { - return ALL_3A_DEBUG_ON || isPropertyOn(PROP_FOCUS_DEBUG_LOG); + public static boolean showFrameDebugLog() { + return ALL_3A_DEBUG_ON || isPropertyOn(PROP_FRAME_LOG); } - public static boolean showFocusDebugUI() { - return ALL_3A_DEBUG_ON || isPropertyOn(PROP_3A_DEBUG_UI); - } - - public static boolean showFaceDebugUI() { - return ALL_3A_DEBUG_ON || isPropertyOn(PROP_3A_DEBUG_UI); + public static boolean showCaptureDebugUI() { + return ALL_3A_DEBUG_ON || isPropertyOn(PROP_CAPTURE_DEBUG_UI); } public static boolean writeCaptureData() { diff --git a/src/com/android/camera/one/v2/OneCameraImpl.java b/src/com/android/camera/one/v2/OneCameraImpl.java index b677275ad..76e3e2997 100644 --- a/src/com/android/camera/one/v2/OneCameraImpl.java +++ b/src/com/android/camera/one/v2/OneCameraImpl.java @@ -85,7 +85,7 @@ public class OneCameraImpl extends AbstractOneCamera { /** If true, will write data about each capture request to disk. */ private static final boolean DEBUG_WRITE_CAPTURE_DATA = DebugPropertyHelper.writeCaptureData(); /** If true, will log per-frame AF info. */ - private static final boolean DEBUG_FOCUS_LOG = DebugPropertyHelper.showFocusDebugLog(); + private static final boolean DEBUG_FOCUS_LOG = DebugPropertyHelper.showFrameDebugLog(); /** Default JPEG encoding quality. */ private static final Byte JPEG_QUALITY = 90; diff --git a/src/com/android/camera/ui/FaceView.java b/src/com/android/camera/ui/FaceView.java index 8d5c292ca..144031f2d 100644 --- a/src/com/android/camera/ui/FaceView.java +++ b/src/com/android/camera/ui/FaceView.java @@ -212,7 +212,7 @@ public class FaceView extends View } mPaint.setColor(mColor); mRect.offset(mPreviewArea.left, mPreviewArea.top); - canvas.drawOval(mRect, mPaint); + canvas.drawRect(mRect, mPaint); } canvas.restore(); } |