summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCheng-Ru Lin <owenlin@google.com>2009-09-30 13:48:59 +0800
committerCheng-Ru Lin <owenlin@google.com>2009-09-30 13:55:29 +0800
commit27e69927ba1a69aaa7a72eab16a278221c2db273 (patch)
treeb4e3265d6fd29cd93f327ff24228895affe580de
parent0685e02a7819b0615e2d23b65b04a6c80f15dd53 (diff)
downloadLegacyCamera-27e69927ba1a69aaa7a72eab16a278221c2db273.zip
LegacyCamera-27e69927ba1a69aaa7a72eab16a278221c2db273.tar.gz
LegacyCamera-27e69927ba1a69aaa7a72eab16a278221c2db273.tar.bz2
Try some mock icons to feel the layout.
Change-Id: I697e45f93e0c6592bdd812f84d5db189f8cf6b4d
-rw-r--r--res/drawable-hdpi/ic_viewfinder_focus_infinity.pngbin0 -> 2559 bytes
-rw-r--r--res/drawable-hdpi/ic_viewfinder_focus_macro.pngbin0 -> 2539 bytes
-rw-r--r--res/drawable-hdpi/ic_viewfinder_whitebalance.pngbin0 -> 1101 bytes
-rw-r--r--res/drawable-mdpi/ic_viewfinder_focus_infinity.pngbin0 -> 5206 bytes
-rw-r--r--res/drawable-mdpi/ic_viewfinder_focus_macro.pngbin0 -> 4754 bytes
-rw-r--r--res/drawable-mdpi/ic_viewfinder_whitebalance.pngbin0 -> 1566 bytes
-rw-r--r--res/layout/camera.xml14
-rw-r--r--res/values/arrays.xml16
-rw-r--r--src/com/android/camera/Camera.java33
9 files changed, 54 insertions, 9 deletions
diff --git a/res/drawable-hdpi/ic_viewfinder_focus_infinity.png b/res/drawable-hdpi/ic_viewfinder_focus_infinity.png
new file mode 100644
index 0000000..bed0f59
--- /dev/null
+++ b/res/drawable-hdpi/ic_viewfinder_focus_infinity.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_viewfinder_focus_macro.png b/res/drawable-hdpi/ic_viewfinder_focus_macro.png
new file mode 100644
index 0000000..317d4a6
--- /dev/null
+++ b/res/drawable-hdpi/ic_viewfinder_focus_macro.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_viewfinder_whitebalance.png b/res/drawable-hdpi/ic_viewfinder_whitebalance.png
new file mode 100644
index 0000000..0475dac
--- /dev/null
+++ b/res/drawable-hdpi/ic_viewfinder_whitebalance.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_viewfinder_focus_infinity.png b/res/drawable-mdpi/ic_viewfinder_focus_infinity.png
new file mode 100644
index 0000000..3971df8
--- /dev/null
+++ b/res/drawable-mdpi/ic_viewfinder_focus_infinity.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_viewfinder_focus_macro.png b/res/drawable-mdpi/ic_viewfinder_focus_macro.png
new file mode 100644
index 0000000..10098fc
--- /dev/null
+++ b/res/drawable-mdpi/ic_viewfinder_focus_macro.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_viewfinder_whitebalance.png b/res/drawable-mdpi/ic_viewfinder_whitebalance.png
new file mode 100644
index 0000000..2f85711
--- /dev/null
+++ b/res/drawable-mdpi/ic_viewfinder_whitebalance.png
Binary files differ
diff --git a/res/layout/camera.xml b/res/layout/camera.xml
index 9b4cf32..8091891 100644
--- a/res/layout/camera.xml
+++ b/res/layout/camera.xml
@@ -58,6 +58,20 @@
<com.android.camera.IconIndicator
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:id="@+id/focus_icon"
+ camera:modes="@array/pref_camera_focusmode_entryvalues"
+ camera:icons="@array/focusmode_icons"
+ android:visibility="visible"/>
+ <com.android.camera.IconIndicator
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:id="@+id/whitebalance_icon"
+ camera:modes="@array/whitebalance_modes"
+ camera:icons="@array/whitebalance_icons"
+ android:visibility="visible"/>
+ <com.android.camera.IconIndicator
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
android:id="@+id/flash_icon"
camera:modes="@array/pref_camera_flashmode_entryvalues"
camera:icons="@array/flash_icons"
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index 66519e9..bdbddef 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -84,6 +84,12 @@
<item>macro</item>
</string-array>
+ <array name="focusmode_icons">
+ <item>0</item>
+ <item>@drawable/ic_viewfinder_focus_infinity</item>
+ <item>@drawable/ic_viewfinder_focus_macro</item>
+ </array>
+
<!-- Camera Preferences flash mode dialog box entries -->
<string-array name="pref_camera_flashmode_entries" translatable="false">
<item>@string/pref_camera_flashmode_entry_auto</item>
@@ -136,6 +142,16 @@
<item>@string/pref_camera_whitebalance_entry_halogen</item>
</string-array>
+ <string-array name="whitebalance_modes" translatable="false">
+ <item>off</item>
+ <item>on</item>
+ </string-array>
+
+ <array name="whitebalance_icons">
+ <item>0</item>
+ <item>@drawable/ic_viewfinder_whitebalance</item>
+ </array>
+
<string-array name="pref_camera_whitebalance_entryvalues" translatable="false">
<item>auto</item>
<item>incandescent</item>
diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java
index b258654..c02c0ce 100644
--- a/src/com/android/camera/Camera.java
+++ b/src/com/android/camera/Camera.java
@@ -99,6 +99,9 @@ public class Camera extends Activity implements View.OnClickListener,
private static final int SCREEN_DELAY = 2 * 60 * 1000;
private static final int FOCUS_BEEP_VOLUME = 100;
+ private static final String WHITE_BALANCE_ON = "on";
+ private static final String WHITE_BALANCE_OFF = "off";
+
private double mZoomValue; // The current zoom value.
private double mZoomStep;
private double mZoomMax;
@@ -139,6 +142,8 @@ public class Camera extends Activity implements View.OnClickListener,
private FocusRectangle mFocusRectangle;
private IconIndicator mGpsIndicator;
private IconIndicator mFlashIndicator;
+ private IconIndicator mFocusIndicator;
+ private IconIndicator mWhitebalanceIndicator;
private ToneGenerator mFocusToneGenerator;
private ZoomButtonsController mZoomButtons;
private GestureDetector mGestureDetector;
@@ -920,6 +925,9 @@ public class Camera extends Activity implements View.OnClickListener,
.setOnTouchListener(new GripperTouchListener());
mFlashIndicator = (IconIndicator) findViewById(R.id.flash_icon);
+ mFocusIndicator = (IconIndicator) findViewById(R.id.focus_icon);
+ mWhitebalanceIndicator =
+ (IconIndicator) findViewById(R.id.whitebalance_icon);
// Make sure preview is started.
try {
@@ -1684,15 +1692,6 @@ public class Camera extends Activity implements View.OnClickListener,
flashMode = Parameters.FLASH_MODE_OFF;
}
- // We post the runner because this function can be called from
- // non-UI thread (i.e., startPreviewThread).
- final String finalFlashMode = flashMode;
- mHandler.post(new Runnable() {
- public void run() {
- mFlashIndicator.setMode(finalFlashMode);
- }
- });
-
// Set white balance parameter.
String whiteBalance = mPreferences.getString(
CameraSettings.KEY_WHITE_BALANCE,
@@ -1725,6 +1724,22 @@ public class Camera extends Activity implements View.OnClickListener,
mParameters.setFocusMode(mFocusMode);
}
+ // We post the runner because this function can be called from
+ // non-UI thread (i.e., startPreviewThread).
+ final String finalWhiteBalance =
+ Parameters.WHITE_BALANCE_AUTO.equals(whiteBalance)
+ ? WHITE_BALANCE_OFF
+ : WHITE_BALANCE_ON;
+ final String finalFlashMode = flashMode;
+
+ mHandler.post(new Runnable() {
+ public void run() {
+ mFocusIndicator.setMode(mFocusMode);
+ mWhitebalanceIndicator.setMode(finalWhiteBalance);
+ mFlashIndicator.setMode(finalFlashMode);
+ }
+ });
+
mCameraDevice.setParameters(mParameters);
}