summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCheng-Ru Lin <owenlin@google.com>2009-09-30 11:57:50 +0800
committerCheng-Ru Lin <owenlin@google.com>2009-09-30 14:42:27 +0800
commit2bc4714bcd7233cd7a3fd0bb4aa261c48d2d9f79 (patch)
tree8487bafc6eb83e578d48737ef73034604ddaea7d
parent0685e02a7819b0615e2d23b65b04a6c80f15dd53 (diff)
downloadLegacyCamera-2bc4714bcd7233cd7a3fd0bb4aa261c48d2d9f79.zip
LegacyCamera-2bc4714bcd7233cd7a3fd0bb4aa261c48d2d9f79.tar.gz
LegacyCamera-2bc4714bcd7233cd7a3fd0bb4aa261c48d2d9f79.tar.bz2
Fine tune some UI stuff.
1. Use no animation between camera / review mode. Thus, we must have same layout for three types of control panel. 2. Since we have better algorithm to calculate the preview size. Let the gripper be the same in mdpi and hdpi devices. 3. Keep some border on the right size of image view. Otherwise, it looks odds in HVGA devices. Change-Id: I65b13222cace230f09e6b33f311fd2b79758e93e
-rw-r--r--AndroidManifest.xml1
-rw-r--r--res/drawable-mdpi/btn_gripper.pngbin379 -> 345 bytes
-rw-r--r--res/layout/attach_camera_control.xml2
-rw-r--r--res/layout/camera_control.xml3
-rw-r--r--res/layout/review_control.xml2
-rw-r--r--src/com/android/camera/PreviewFrameLayout.java11
6 files changed, 13 insertions, 6 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 8bd652a..823dcd9 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -125,6 +125,7 @@
</activity>
<activity android:name="ReviewImage"
android:label="@string/view_label"
+ android:theme="@style/CustomTheme"
android:screenOrientation="behind"
android:configChanges="orientation|keyboardHidden">
<intent-filter>
diff --git a/res/drawable-mdpi/btn_gripper.png b/res/drawable-mdpi/btn_gripper.png
index 93fcd89..5c70bbc 100644
--- a/res/drawable-mdpi/btn_gripper.png
+++ b/res/drawable-mdpi/btn_gripper.png
Binary files differ
diff --git a/res/layout/attach_camera_control.xml b/res/layout/attach_camera_control.xml
index 5de98a6..f4650b4 100644
--- a/res/layout/attach_camera_control.xml
+++ b/res/layout/attach_camera_control.xml
@@ -18,7 +18,7 @@
xmlns:camera="http://schemas.android.com/apk/res/com.android.camera"
android:id="@+id/control_bar"
android:layout_height="fill_parent"
- android:layout_width="77dp"
+ android:layout_width="76dp"
android:layout_marginTop="13dp"
android:layout_marginBottom="10dp"
android:layout_alignParentRight="true">
diff --git a/res/layout/camera_control.xml b/res/layout/camera_control.xml
index 982d707..8f7f6c8 100644
--- a/res/layout/camera_control.xml
+++ b/res/layout/camera_control.xml
@@ -18,8 +18,7 @@
android:id="@+id/control_bar"
android:orientation="vertical"
android:layout_height="fill_parent"
- android:layout_width="wrap_content"
- android:layout_marginRight="0dp"
+ android:layout_width="76dp"
android:layout_marginTop="13dp"
android:layout_marginBottom="10dp"
android:layout_alignParentRight="true">
diff --git a/res/layout/review_control.xml b/res/layout/review_control.xml
index c470653..a1291a5 100644
--- a/res/layout/review_control.xml
+++ b/res/layout/review_control.xml
@@ -19,7 +19,7 @@
android:id="@+id/button_bar"
android:gravity="center_horizontal"
android:layout_height="fill_parent"
- android:layout_width="77dp"
+ android:layout_width="76dp"
android:layout_marginTop="13dp"
android:layout_marginBottom="10dp"
android:layout_alignParentRight="true">
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;