summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;