summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWu-cheng Li <wuchengli@google.com>2011-04-27 17:56:09 +0800
committerWu-cheng Li <wuchengli@google.com>2011-04-28 12:37:04 +0800
commitfeaf2ccff42c44b74be814b66296f9ddedcc9aa9 (patch)
tree0a077d6d11481c12beb0665fb5ff7a3e9ad140c5
parent18c1ad898f3fddcd321af7ffbb32416a1b32f323 (diff)
downloadLegacyCamera-feaf2ccff42c44b74be814b66296f9ddedcc9aa9.zip
LegacyCamera-feaf2ccff42c44b74be814b66296f9ddedcc9aa9.tar.gz
LegacyCamera-feaf2ccff42c44b74be814b66296f9ddedcc9aa9.tar.bz2
Reduce the size of focus rectangle.
Now the length of focus rectangle is 1/4 of the height of preview frame. bug:3475893 Change-Id: Ib1f09d5dbb25bb20343b39116c12febe08d83051
-rw-r--r--res/layout-xlarge/preview_frame.xml4
-rw-r--r--res/layout/preview_frame.xml4
-rw-r--r--src/com/android/camera/Camera.java9
-rw-r--r--src/com/android/camera/Util.java2
-rw-r--r--src/com/android/camera/ui/IndicatorWheel.java1
5 files changed, 12 insertions, 8 deletions
diff --git a/res/layout-xlarge/preview_frame.xml b/res/layout-xlarge/preview_frame.xml
index c90a0a9..9a1eb99 100644
--- a/res/layout-xlarge/preview_frame.xml
+++ b/res/layout-xlarge/preview_frame.xml
@@ -32,8 +32,8 @@
android:background="@drawable/border_preview_holo"/>
<com.android.camera.ui.FocusRectangle
android:id="@+id/focus_rectangle"
- android:layout_width="300dp"
- android:layout_height="300dp"
+ android:layout_width="180dp"
+ android:layout_height="180dp"
android:layout_centerInParent="true"/>
<TextView android:id="@+id/zoom_ratio"
style="@style/OnViewfinderLabel"
diff --git a/res/layout/preview_frame.xml b/res/layout/preview_frame.xml
index 6f5f428..693ae65 100644
--- a/res/layout/preview_frame.xml
+++ b/res/layout/preview_frame.xml
@@ -31,8 +31,8 @@
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<com.android.camera.ui.FocusRectangle android:id="@+id/focus_rectangle"
- android:layout_width="100dp"
- android:layout_height="100dp"
+ android:layout_width="120dp"
+ android:layout_height="120dp"
android:layout_centerInParent="true"/>
</RelativeLayout>
</com.android.camera.PreviewFrameLayout>
diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java
index 8677c9a..909d218 100644
--- a/src/com/android/camera/Camera.java
+++ b/src/com/android/camera/Camera.java
@@ -387,6 +387,11 @@ public class Camera extends ActivityBase implements View.OnClickListener,
mPreviewFrame = findViewById(R.id.camera_preview);
mPreviewFrame.setOnTouchListener(this);
mPreviewBorder = (View) findViewById(R.id.preview_border);
+ // Set the length of focus rectangle according to preview frame size.
+ int len = Math.min(mPreviewFrame.getWidth(), mPreviewFrame.getHeight()) / 4;
+ ViewGroup.LayoutParams layout = mFocusRectangle.getLayoutParams();
+ layout.width = len;
+ layout.height = len;
updateFocusIndicator();
initializeScreenBrightness();
@@ -2173,7 +2178,7 @@ public class Camera extends ActivityBase implements View.OnClickListener,
1000,
0F,
mLocationListeners[1]);
- } catch (java.lang.SecurityException ex) {
+ } catch (SecurityException ex) {
Log.i(TAG, "fail to request location update, ignore", ex);
} catch (IllegalArgumentException ex) {
Log.d(TAG, "provider does not exist " + ex.getMessage());
@@ -2185,7 +2190,7 @@ public class Camera extends ActivityBase implements View.OnClickListener,
0F,
mLocationListeners[0]);
showGpsOnScreenIndicator(false);
- } catch (java.lang.SecurityException ex) {
+ } catch (SecurityException ex) {
Log.i(TAG, "fail to request location update, ignore", ex);
} catch (IllegalArgumentException ex) {
Log.d(TAG, "provider does not exist " + ex.getMessage());
diff --git a/src/com/android/camera/Util.java b/src/com/android/camera/Util.java
index cfef950..5cafe7a 100644
--- a/src/com/android/camera/Util.java
+++ b/src/com/android/camera/Util.java
@@ -404,7 +404,7 @@ public class Util {
} catch (java.lang.reflect.InvocationTargetException ite) {
// Failure, must be another device.
// Assume that it is voice capable.
- } catch (java.lang.IllegalAccessException iae) {
+ } catch (IllegalAccessException iae) {
// Failure, must be an other device.
// Assume that it is voice capable.
} catch (NoSuchMethodException nsme) {
diff --git a/src/com/android/camera/ui/IndicatorWheel.java b/src/com/android/camera/ui/IndicatorWheel.java
index e24fbc5..8ddd7cd 100644
--- a/src/com/android/camera/ui/IndicatorWheel.java
+++ b/src/com/android/camera/ui/IndicatorWheel.java
@@ -38,7 +38,6 @@ import android.view.MotionEvent;
import android.view.ViewGroup;
import android.view.View;
-import java.lang.Math;
import java.util.ArrayList;
/**