diff options
author | akahuang <akahuang@google.com> | 2012-04-18 11:28:01 +0800 |
---|---|---|
committer | Eino-Ville Talvala <etalvala@google.com> | 2012-06-15 13:39:00 -0700 |
commit | a96fbc672886ddac5169a7e8ddbfecf535770669 (patch) | |
tree | a5ff40a55dc238f6475252f15c10500a5ce0f3b6 | |
parent | 14f75622cf4b651089594d155a9c6a0000c51b17 (diff) | |
download | LegacyCamera-a96fbc672886ddac5169a7e8ddbfecf535770669.zip LegacyCamera-a96fbc672886ddac5169a7e8ddbfecf535770669.tar.gz LegacyCamera-a96fbc672886ddac5169a7e8ddbfecf535770669.tar.bz2 |
Fix camera_control distorted in small resolution.
Use minimum height of camera_control to fix it.
bug:6228273
Change-Id: I7c623efe06e043664d696f753f08877cd34450a1
-rw-r--r-- | res/layout/camera_control.xml | 3 | ||||
-rw-r--r-- | res/layout/mode_picker.xml | 3 | ||||
-rw-r--r-- | src/com/android/camera/ui/ControlPanelLayout.java | 8 |
3 files changed, 10 insertions, 4 deletions
diff --git a/res/layout/camera_control.xml b/res/layout/camera_control.xml index 3595849..9e05183 100644 --- a/res/layout/camera_control.xml +++ b/res/layout/camera_control.xml @@ -14,11 +14,12 @@ limitations under the License. --> +<!-- minHeight is necessary to avoid distortion or overlapping. --> <com.android.camera.ui.ControlPanelLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/control_panel" android:layout_width="match_parent" android:layout_height="wrap_content" - android:minHeight="76dp" + android:minHeight="105dp" android:background="@drawable/bg_camera_pattern"> <include layout="@layout/review_thumbnail" /> <include layout="@layout/review_control" /> diff --git a/res/layout/mode_picker.xml b/res/layout/mode_picker.xml index 1b5e16b..27eb0b0 100644 --- a/res/layout/mode_picker.xml +++ b/res/layout/mode_picker.xml @@ -19,15 +19,14 @@ android:layout_width="wrap_content" android:layout_alignParentLeft="true" android:visibility="gone"> + <!-- minHeight in camera_control.xml is used to avoid overlapping of current_mode. --> <RelativeLayout android:id="@+id/current_mode" - android:orientation="horizontal" android:layout_alignLeft="@+id/mode_selection" android:layout_height="match_parent" android:layout_width="55dp" android:contentDescription="@string/accessibility_mode_picker" android:background="@drawable/bg_mode_picker"> <RelativeLayout - android:orientation="vertical" android:contentDescription="@string/empty" android:layout_height="match_parent" android:layout_width="match_parent"> diff --git a/src/com/android/camera/ui/ControlPanelLayout.java b/src/com/android/camera/ui/ControlPanelLayout.java index 24efb8b..c3ae9c0 100644 --- a/src/com/android/camera/ui/ControlPanelLayout.java +++ b/src/com/android/camera/ui/ControlPanelLayout.java @@ -66,7 +66,13 @@ public class ControlPanelLayout extends RelativeLayout { Log.e(TAG, "layout_xxx of ControlPanelLayout should be wrap_content"); } - // The width cannot be bigger than the constraint. + // The size cannot be smaller than minimum constraint. + int minimumSize = (isLandscape) ? getMinimumWidth() : getMinimumHeight(); + if (measuredSize < minimumSize) { + measuredSize = minimumSize; + } + + // The size cannot be bigger than the constraint. if (mode == MeasureSpec.AT_MOST && measuredSize > specSize) { measuredSize = specSize; } |