summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/VideoUI.java
diff options
context:
space:
mode:
authorjunjiez <junjiez@codeaurora.org>2016-09-14 13:54:16 +0800
committerjunjiez <junjiez@codeaurora.org>2016-09-14 13:54:54 +0800
commitdf23d71189d514eecf8e358f135823e5f540abb9 (patch)
tree83a39ccb3874f598295ea59130b7218c6eab6077 /src/com/android/camera/VideoUI.java
parentdaee7f193c91bee48ce3b12fc7a0e988aa8ce02f (diff)
downloadandroid_packages_apps_Snap-df23d71189d514eecf8e358f135823e5f540abb9.tar.gz
android_packages_apps_Snap-df23d71189d514eecf8e358f135823e5f540abb9.tar.bz2
android_packages_apps_Snap-df23d71189d514eecf8e358f135823e5f540abb9.zip
SnapdragonCamera:Fix Face circles are drawn at an offset
The layoutParam of FaceView is not the same as prview surface, and cause the offset.Remove setting layoutParam in the method onStartFaceDetection() and calculate the screen ratio in the VideoModule to get the correct layoutParam for FaceView Change-Id: I9bc2759bcb50514c183628e9d4f31d2f54437dc7 CRs-Fixed: 1064295
Diffstat (limited to 'src/com/android/camera/VideoUI.java')
-rw-r--r--src/com/android/camera/VideoUI.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/com/android/camera/VideoUI.java b/src/com/android/camera/VideoUI.java
index 00f3c705a..0071f28a3 100644
--- a/src/com/android/camera/VideoUI.java
+++ b/src/com/android/camera/VideoUI.java
@@ -402,6 +402,7 @@ public class VideoUI implements PieRenderer.PieListener,
float scaledTextureWidth, scaledTextureHeight;
int rotation = CameraUtil.getDisplayRotation(mActivity);
+ mScreenRatio = CameraUtil.determineRatio(ratio);
if (mScreenRatio == CameraUtil.RATIO_16_9
&& CameraUtil.determinCloseRatio(ratio) == CameraUtil.RATIO_4_3) {
int l = (mTopMargin + mBottomMargin) * 4;
@@ -434,6 +435,9 @@ public class VideoUI implements PieRenderer.PieListener,
}
} else {
float width = mMaxPreviewWidth, height = mMaxPreviewHeight;
+ if (width == 0 || height == 0) return;
+ if(mScreenRatio == CameraUtil.RATIO_4_3)
+ height -= (mTopMargin + mBottomMargin);
if (mOrientationResize) {
scaledTextureWidth = height * mAspectRatio;
if (scaledTextureWidth > width) {
@@ -1252,9 +1256,6 @@ public class VideoUI implements PieRenderer.PieListener,
mFaceView.setVisibility(View.VISIBLE);
mFaceView.setDisplayOrientation(orientation);
mFaceView.setMirror(mirror);
- LayoutParams layoutParams = new LayoutParams(
- LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
- mFaceView.setLayoutParams(layoutParams);
mFaceView.resume();
}