summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamera Software Integration <camswint@localhost>2015-12-17 10:32:02 -0800
committerMichael Bestas <mikeioannina@cyanogenmod.org>2016-02-16 15:44:53 +0200
commita05f9ce2cfa6dc7f94d38580d0ce7092b5507947 (patch)
treee9b3f82abebcf1246d6d963ca535582d79e5e50d
parent808bc73d3cb6f954eec9798c555373bd8c3bca93 (diff)
downloadandroid_packages_apps_Snap-a05f9ce2cfa6dc7f94d38580d0ce7092b5507947.zip
android_packages_apps_Snap-a05f9ce2cfa6dc7f94d38580d0ce7092b5507947.tar.gz
android_packages_apps_Snap-a05f9ce2cfa6dc7f94d38580d0ce7092b5507947.tar.bz2
SnapdragonCamera: Adjust margin on PhotoUI
Adjust top and bottom margin on every ratio. Change-Id: I755c15039e355d13bcc08e6463f38deba668a234 CRs-Fixed: 951525
-rw-r--r--src/com/android/camera/PhotoUI.java16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java
index 3a9a2c1..88cc2b8 100644
--- a/src/com/android/camera/PhotoUI.java
+++ b/src/com/android/camera/PhotoUI.java
@@ -303,16 +303,18 @@ public class PhotoUI implements PieListener,
Point size = new Point();
mActivity.getWindowManager().getDefaultDisplay().getRealSize(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);
}
+ 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 setDownFactor(int factor) {
mDownSampleFactor = factor;
}