diff options
author | Camera Software Integration <camswint@localhost> | 2015-12-17 10:32:02 -0800 |
---|---|---|
committer | Michael Bestas <mikeioannina@cyanogenmod.org> | 2016-02-16 15:44:53 +0200 |
commit | a05f9ce2cfa6dc7f94d38580d0ce7092b5507947 (patch) | |
tree | e9b3f82abebcf1246d6d963ca535582d79e5e50d /src/com/android/camera | |
parent | 808bc73d3cb6f954eec9798c555373bd8c3bca93 (diff) | |
download | android_packages_apps_Snap-a05f9ce2cfa6dc7f94d38580d0ce7092b5507947.tar.gz android_packages_apps_Snap-a05f9ce2cfa6dc7f94d38580d0ce7092b5507947.tar.bz2 android_packages_apps_Snap-a05f9ce2cfa6dc7f94d38580d0ce7092b5507947.zip |
SnapdragonCamera: Adjust margin on PhotoUI
Adjust top and bottom margin on every ratio.
Change-Id: I755c15039e355d13bcc08e6463f38deba668a234
CRs-Fixed: 951525
Diffstat (limited to 'src/com/android/camera')
-rw-r--r-- | src/com/android/camera/PhotoUI.java | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java index 3a9a2c13c..88cc2b856 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; } |