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
committerGerrit - the friendly Code Review server <code-review@localhost>2016-09-04 18:49:48 -0700
commitdf814fb6c36e8b0a94bae828c8d02b0b95945534 (patch)
treebe89eba7951db15867e07f674c6a1d435a99077d /src/com/android/camera/VideoUI.java
parent050fe78517519b689ce5adff1cf2c074bcbd186e (diff)
downloadandroid_packages_apps_Snap-df814fb6c36e8b0a94bae828c8d02b0b95945534.tar.gz
android_packages_apps_Snap-df814fb6c36e8b0a94bae828c8d02b0b95945534.tar.bz2
android_packages_apps_Snap-df814fb6c36e8b0a94bae828c8d02b0b95945534.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 41b9cfd89..00f3c705a 100644
--- a/src/com/android/camera/VideoUI.java
+++ b/src/com/android/camera/VideoUI.java
@@ -295,17 +295,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;