summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/VideoUI.java
diff options
context:
space:
mode:
authorjunjiez <junjiez@codeaurora.org>2016-08-11 16:17:37 +0800
committerjunjiez <junjiez@codeaurora.org>2016-08-11 16:27:45 +0800
commit8f4c85f6cc70934a4ecec31bad05fef8b5b67d42 (patch)
treea1e648de21a9979b2c1dd32dbb0cc83cb4d3e1b2 /src/com/android/camera/VideoUI.java
parent9f65ee95c61d70d6f7c34cd8bedea61ff1cdf2d1 (diff)
downloadandroid_packages_apps_Snap-8f4c85f6cc70934a4ecec31bad05fef8b5b67d42.tar.gz
android_packages_apps_Snap-8f4c85f6cc70934a4ecec31bad05fef8b5b67d42.tar.bz2
android_packages_apps_Snap-8f4c85f6cc70934a4ecec31bad05fef8b5b67d42.zip
SnapdragonCamera:Fix abnormal menu after switch camcorder to camera
VedioUI don't calculate margins for cameraControls when the screen ratio isn't 16:9, this will cause abnormal menu in the device, so alway calculate margins. Change-Id: If55008bc549c852ee499228094d49d7eb1d80c5d CRs-Fixed: 1052562
Diffstat (limited to 'src/com/android/camera/VideoUI.java')
-rw-r--r--src/com/android/camera/VideoUI.java16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/com/android/camera/VideoUI.java b/src/com/android/camera/VideoUI.java
index 5203d9e35..99efb96c5 100644
--- a/src/com/android/camera/VideoUI.java
+++ b/src/com/android/camera/VideoUI.java
@@ -286,17 +286,19 @@ public class VideoUI implements PieRenderer.PieListener,
Point size = new Point();
mActivity.getWindowManager().getDefaultDisplay().getSize(size);
mScreenRatio = CameraUtil.determineRatio(size.x, size.y);
- if (mScreenRatio == CameraUtil.RATIO_16_9) {
- int l = size.x > size.y ? size.x : size.y;
- int tm = mActivity.getResources().getDimensionPixelSize(R.dimen.preview_top_margin);
- int bm = mActivity.getResources().getDimensionPixelSize(R.dimen.preview_bottom_margin);
- mTopMargin = l / 4 * tm / (tm + bm);
- mBottomMargin = l / 4 - mTopMargin;
- }
+ calculateMargins(size);
mCameraControls.setMargins(mTopMargin, mBottomMargin);
((ViewGroup)mRootView).removeView(mRecordingTimeRect);
}
+ private void calculateMargins(Point size) {
+ int l = size.x > size.y ? size.x : size.y;
+ int tm = mActivity.getResources().getDimensionPixelSize(R.dimen.preview_top_margin);
+ int bm = mActivity.getResources().getDimensionPixelSize(R.dimen.preview_bottom_margin);
+ mTopMargin = l / 4 * tm / (tm + bm);
+ mBottomMargin = l / 4 - mTopMargin;
+ }
+
public void cameraOrientationPreviewResize(boolean orientation){
mPrevOrientationResize = mOrientationResize;
mOrientationResize = orientation;