diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-09-30 12:55:42 -0400 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-09-30 12:55:42 -0400 |
commit | c90610f56293c93f4a7c7a67d8bbf0edb96bc57d (patch) | |
tree | 73a2b33108fdd783ae959506ea719858b349b259 /src/com/android/camera | |
parent | aeba0abdbe27cb6ba6f0de41d56bf72a811aac59 (diff) | |
parent | 2bc4714bcd7233cd7a3fd0bb4aa261c48d2d9f79 (diff) | |
download | LegacyCamera-c90610f56293c93f4a7c7a67d8bbf0edb96bc57d.zip LegacyCamera-c90610f56293c93f4a7c7a67d8bbf0edb96bc57d.tar.gz LegacyCamera-c90610f56293c93f4a7c7a67d8bbf0edb96bc57d.tar.bz2 |
Merge change I65b13222 into eclair
* changes:
Fine tune some UI stuff.
Diffstat (limited to 'src/com/android/camera')
-rw-r--r-- | src/com/android/camera/PreviewFrameLayout.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/com/android/camera/PreviewFrameLayout.java b/src/com/android/camera/PreviewFrameLayout.java index 459338c..7ef9206 100644 --- a/src/com/android/camera/PreviewFrameLayout.java +++ b/src/com/android/camera/PreviewFrameLayout.java @@ -16,14 +16,18 @@ package com.android.camera; +import android.app.Activity; import android.content.Context; import android.util.AttributeSet; +import android.util.DisplayMetrics; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.FrameLayout; public class PreviewFrameLayout extends ViewGroup { + private static final int MIN_HORIZONTAL_MARGIN = 10; // 10dp + public interface OnSizeChangedListener { public void onSizeChanged(); } @@ -32,10 +36,12 @@ public class PreviewFrameLayout extends ViewGroup { private ImageView mGripper; private FrameLayout mFrame; private OnSizeChangedListener mSizeListener; - + private DisplayMetrics mMetrics = new DisplayMetrics(); public PreviewFrameLayout(Context context, AttributeSet attrs) { super(context, attrs); + ((Activity) context).getWindowManager() + .getDefaultDisplay().getMetrics(mMetrics); } public void setOnSizeChangedListener(OnSizeChangedListener listener) { @@ -74,7 +80,8 @@ public class PreviewFrameLayout extends ViewGroup { gripperHeight = mGripper.getMeasuredHeight(); } - int frameWidth = getMeasuredWidth() - gripperWidth; + int frameWidth = getMeasuredWidth() - (int) Math.max( + gripperWidth, MIN_HORIZONTAL_MARGIN * mMetrics.density); int frameHeight = getMeasuredHeight(); FrameLayout f = mFrame; |