Merge "Hide focus ring when auto focusing in camera and video" into gb-ub-photos-denali
diff --git a/src/com/android/camera/FocusOverlayManager.java b/src/com/android/camera/FocusOverlayManager.java
index da50bd0..59875c8 100644
--- a/src/com/android/camera/FocusOverlayManager.java
+++ b/src/com/android/camera/FocusOverlayManager.java
@@ -98,7 +98,7 @@
public interface FocusUI {
public boolean hasFaces();
public void clearFocus();
- public void setFocusPosition(int x, int y);
+ public void setFocusPosition(int x, int y, boolean isAutoFocus);
public void onFocusStarted();
public void onFocusSucceeded();
public void onFocusFailed();
@@ -321,7 +321,7 @@
// animate on false->true trasition only b/8219520
if (moving && !mPreviousMoving) {
// Auto focus at the center of the preview.
- mUI.setFocusPosition(mPreviewRect.centerX(), mPreviewRect.centerY());
+ mUI.setFocusPosition(mPreviewRect.centerX(), mPreviewRect.centerY(), true);
mUI.onFocusStarted();
} else if (!moving) {
mUI.onFocusSucceeded();
@@ -375,7 +375,7 @@
}
// Use margin to set the focus indicator to the touched area.
- mUI.setFocusPosition(x, y);
+ mUI.setFocusPosition(x, y, false);
// Stop face detection because we want to specify focus and metering area.
mListener.stopFaceDetection();
diff --git a/src/com/android/camera/ui/FocusOverlay.java b/src/com/android/camera/ui/FocusOverlay.java
index 0c2bb22..32f50d5 100644
--- a/src/com/android/camera/ui/FocusOverlay.java
+++ b/src/com/android/camera/ui/FocusOverlay.java
@@ -46,6 +46,7 @@
private final int mFocusIndicatorSize;
private boolean mShowIndicator;
private final int mFocusOuterRingSize;
+ private boolean mCurrentRunIsAutoFocus = true;
public FocusOverlay(Context context, AttributeSet attrs) {
super(context, attrs);
@@ -67,7 +68,7 @@
}
@Override
- public void setFocusPosition(int x, int y) {
+ public void setFocusPosition(int x, int y, boolean isAutoFocus) {
mPositionX = x;
mPositionY = y;
mBounds.set(x - mFocusIndicatorSize / 2, y - mFocusIndicatorSize / 2,
@@ -75,6 +76,7 @@
mFocusIndicator.setBounds(mBounds);
mFocusOuterRing.setBounds(x - mFocusOuterRingSize / 2, y - mFocusOuterRingSize / 2,
x + mFocusOuterRingSize / 2, y + mFocusOuterRingSize / 2);
+ mCurrentRunIsAutoFocus = isAutoFocus;
}
@Override
@@ -120,7 +122,7 @@
public void onDraw(Canvas canvas) {
super.onDraw(canvas);
- if (mShowIndicator) {
+ if (mShowIndicator && !mCurrentRunIsAutoFocus) {
mFocusOuterRing.draw(canvas);
canvas.save();
canvas.rotate(mAngle, mPositionX, mPositionY);