summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChih-yu Huang <akahuang@google.com>2011-08-23 15:31:36 +0800
committerChih-yu Huang <akahuang@google.com>2011-08-26 19:52:20 +0800
commit0935e09bb12a1886a801713bbd78bbc20bf4ea4e (patch)
treecdfcc46510097d40f93b395862c33c550171dbf3
parent6f6ea6ab6dad370d2cc378be91a2649ae44b2c94 (diff)
downloadLegacyCamera-0935e09bb12a1886a801713bbd78bbc20bf4ea4e.zip
LegacyCamera-0935e09bb12a1886a801713bbd78bbc20bf4ea4e.tar.gz
LegacyCamera-0935e09bb12a1886a801713bbd78bbc20bf4ea4e.tar.bz2
Change front/back switcher icon in camera mode
bug:5198658 Change-Id: I4a0f91f9318313c219904c3417fbf98a256cfac3
-rw-r--r--res/drawable-hdpi/ic_switch_camera_facing_holo_light.pngbin1725 -> 0 bytes
-rw-r--r--res/drawable-hdpi/ic_switch_photo_facing_holo_light.pngbin0 -> 1978 bytes
-rw-r--r--res/drawable-hdpi/ic_switch_video_facing_holo_light.pngbin0 -> 1691 bytes
-rw-r--r--res/drawable-mdpi/ic_switch_camera_facing_holo_light.pngbin1105 -> 0 bytes
-rw-r--r--res/drawable-mdpi/ic_switch_photo_facing_holo_light.pngbin0 -> 1218 bytes
-rw-r--r--res/drawable-mdpi/ic_switch_video_facing_holo_light.pngbin0 -> 1101 bytes
-rw-r--r--res/drawable-w1024dp-hdpi/ic_switch_photo_facing_holo_light.pngbin0 -> 3622 bytes
-rw-r--r--res/drawable-w1024dp-hdpi/ic_switch_video_facing_holo_light.png (renamed from res/drawable-w1024dp-hdpi/ic_switch_camera_facing_holo_light.png)bin2853 -> 2853 bytes
-rw-r--r--res/drawable-w1024dp-mdpi/ic_switch_photo_facing_holo_light.pngbin0 -> 2209 bytes
-rw-r--r--res/drawable-w1024dp-mdpi/ic_switch_video_facing_holo_light.png (renamed from res/drawable-w1024dp-mdpi/ic_switch_camera_facing_holo_light.png)bin1762 -> 1762 bytes
-rw-r--r--res/drawable-w1024dp-xhdpi/ic_switch_photo_facing_holo_light.pngbin0 -> 5115 bytes
-rw-r--r--res/drawable-w1024dp-xhdpi/ic_switch_video_facing_holo_light.png (renamed from res/drawable-w1024dp-xhdpi/ic_switch_camera_facing_holo_light.png)bin3954 -> 3954 bytes
-rw-r--r--res/drawable-xhdpi/ic_switch_camera_facing_holo_light.pngbin2391 -> 0 bytes
-rw-r--r--res/drawable-xhdpi/ic_switch_photo_facing_holo_light.pngbin0 -> 2745 bytes
-rw-r--r--res/drawable-xhdpi/ic_switch_video_facing_holo_light.pngbin0 -> 2359 bytes
-rw-r--r--src/com/android/camera/Camera.java3
-rw-r--r--src/com/android/camera/VideoCamera.java3
-rw-r--r--src/com/android/camera/ui/CameraPicker.java8
-rw-r--r--src/com/android/camera/ui/IndicatorControlBarContainer.java5
-rw-r--r--src/com/android/camera/ui/IndicatorControlWheel.java3
20 files changed, 18 insertions, 4 deletions
diff --git a/res/drawable-hdpi/ic_switch_camera_facing_holo_light.png b/res/drawable-hdpi/ic_switch_camera_facing_holo_light.png
deleted file mode 100644
index c76c064..0000000
--- a/res/drawable-hdpi/ic_switch_camera_facing_holo_light.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_switch_photo_facing_holo_light.png b/res/drawable-hdpi/ic_switch_photo_facing_holo_light.png
new file mode 100644
index 0000000..ea65607
--- /dev/null
+++ b/res/drawable-hdpi/ic_switch_photo_facing_holo_light.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_switch_video_facing_holo_light.png b/res/drawable-hdpi/ic_switch_video_facing_holo_light.png
new file mode 100644
index 0000000..3176041
--- /dev/null
+++ b/res/drawable-hdpi/ic_switch_video_facing_holo_light.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_switch_camera_facing_holo_light.png b/res/drawable-mdpi/ic_switch_camera_facing_holo_light.png
deleted file mode 100644
index fe2ccaf..0000000
--- a/res/drawable-mdpi/ic_switch_camera_facing_holo_light.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_switch_photo_facing_holo_light.png b/res/drawable-mdpi/ic_switch_photo_facing_holo_light.png
new file mode 100644
index 0000000..47726c0
--- /dev/null
+++ b/res/drawable-mdpi/ic_switch_photo_facing_holo_light.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_switch_video_facing_holo_light.png b/res/drawable-mdpi/ic_switch_video_facing_holo_light.png
new file mode 100644
index 0000000..48b85c9
--- /dev/null
+++ b/res/drawable-mdpi/ic_switch_video_facing_holo_light.png
Binary files differ
diff --git a/res/drawable-w1024dp-hdpi/ic_switch_photo_facing_holo_light.png b/res/drawable-w1024dp-hdpi/ic_switch_photo_facing_holo_light.png
new file mode 100644
index 0000000..b73a52a
--- /dev/null
+++ b/res/drawable-w1024dp-hdpi/ic_switch_photo_facing_holo_light.png
Binary files differ
diff --git a/res/drawable-w1024dp-hdpi/ic_switch_camera_facing_holo_light.png b/res/drawable-w1024dp-hdpi/ic_switch_video_facing_holo_light.png
index 51244d8..d61eb24 100644
--- a/res/drawable-w1024dp-hdpi/ic_switch_camera_facing_holo_light.png
+++ b/res/drawable-w1024dp-hdpi/ic_switch_video_facing_holo_light.png
Binary files differ
diff --git a/res/drawable-w1024dp-mdpi/ic_switch_photo_facing_holo_light.png b/res/drawable-w1024dp-mdpi/ic_switch_photo_facing_holo_light.png
new file mode 100644
index 0000000..566b5fc
--- /dev/null
+++ b/res/drawable-w1024dp-mdpi/ic_switch_photo_facing_holo_light.png
Binary files differ
diff --git a/res/drawable-w1024dp-mdpi/ic_switch_camera_facing_holo_light.png b/res/drawable-w1024dp-mdpi/ic_switch_video_facing_holo_light.png
index ff108f5..c1411dd 100644
--- a/res/drawable-w1024dp-mdpi/ic_switch_camera_facing_holo_light.png
+++ b/res/drawable-w1024dp-mdpi/ic_switch_video_facing_holo_light.png
Binary files differ
diff --git a/res/drawable-w1024dp-xhdpi/ic_switch_photo_facing_holo_light.png b/res/drawable-w1024dp-xhdpi/ic_switch_photo_facing_holo_light.png
new file mode 100644
index 0000000..d6b4f81
--- /dev/null
+++ b/res/drawable-w1024dp-xhdpi/ic_switch_photo_facing_holo_light.png
Binary files differ
diff --git a/res/drawable-w1024dp-xhdpi/ic_switch_camera_facing_holo_light.png b/res/drawable-w1024dp-xhdpi/ic_switch_video_facing_holo_light.png
index cb17d4f..376d868 100644
--- a/res/drawable-w1024dp-xhdpi/ic_switch_camera_facing_holo_light.png
+++ b/res/drawable-w1024dp-xhdpi/ic_switch_video_facing_holo_light.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_switch_camera_facing_holo_light.png b/res/drawable-xhdpi/ic_switch_camera_facing_holo_light.png
deleted file mode 100644
index 913b3be..0000000
--- a/res/drawable-xhdpi/ic_switch_camera_facing_holo_light.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_switch_photo_facing_holo_light.png b/res/drawable-xhdpi/ic_switch_photo_facing_holo_light.png
new file mode 100644
index 0000000..3b44928
--- /dev/null
+++ b/res/drawable-xhdpi/ic_switch_photo_facing_holo_light.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_switch_video_facing_holo_light.png b/res/drawable-xhdpi/ic_switch_video_facing_holo_light.png
new file mode 100644
index 0000000..9ef6f34
--- /dev/null
+++ b/res/drawable-xhdpi/ic_switch_video_facing_holo_light.png
Binary files differ
diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java
index d682480..a71954c 100644
--- a/src/com/android/camera/Camera.java
+++ b/src/com/android/camera/Camera.java
@@ -16,6 +16,7 @@
package com.android.camera;
+import com.android.camera.ui.CameraPicker;
import com.android.camera.ui.FaceView;
import com.android.camera.ui.FocusRectangle;
import com.android.camera.ui.IndicatorControl;
@@ -1102,6 +1103,8 @@ public class Camera extends ActivityBase implements FocusManager.Listener,
CameraSettings.KEY_FOCUS_MODE,
CameraSettings.KEY_EXPOSURE,
CameraSettings.KEY_PICTURE_SIZE};
+
+ CameraPicker.setImageResourceId(R.drawable.ic_switch_photo_facing_holo_light);
mIndicatorControl.initialize(this, mPreferenceGroup,
CameraSettings.KEY_FLASH_MODE, SETTING_KEYS, OTHER_SETTING_KEYS);
mIndicatorControl.setListener(this);
diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java
index 0634c40..744357a 100644
--- a/src/com/android/camera/VideoCamera.java
+++ b/src/com/android/camera/VideoCamera.java
@@ -16,6 +16,7 @@
package com.android.camera;
+import com.android.camera.ui.CameraPicker;
import com.android.camera.ui.IndicatorControl;
import com.android.camera.ui.IndicatorControlWheelContainer;
import com.android.camera.ui.RotateImageView;
@@ -473,6 +474,8 @@ public class VideoCamera extends ActivityBase
CameraSettings.KEY_VIDEO_QUALITY};
final String[] OTHER_SETTING_KEYS = {
CameraSettings.KEY_VIDEO_TIME_LAPSE_FRAME_INTERVAL};
+
+ CameraPicker.setImageResourceId(R.drawable.ic_switch_video_facing_holo_light);
mIndicatorControl.initialize(this, mPreferenceGroup,
CameraSettings.KEY_VIDEOCAMERA_FLASH_MODE,
SETTING_KEYS, OTHER_SETTING_KEYS);
diff --git a/src/com/android/camera/ui/CameraPicker.java b/src/com/android/camera/ui/CameraPicker.java
index 6bdfe43..8b4596a 100644
--- a/src/com/android/camera/ui/CameraPicker.java
+++ b/src/com/android/camera/ui/CameraPicker.java
@@ -29,6 +29,8 @@ import android.widget.ImageView;
* A view for switching the front/back camera.
*/
public class CameraPicker extends RotateImageView implements View.OnClickListener {
+ private static int mImageResource;
+
private OnPreferenceChangedListener mListener;
private ListPreference mPreference;
private CharSequence[] mCameras;
@@ -36,7 +38,11 @@ public class CameraPicker extends RotateImageView implements View.OnClickListene
public CameraPicker(Context context) {
super(context);
- setImageResource(R.drawable.ic_switch_camera_facing_holo_light);
+ setImageResource(mImageResource);
+ }
+
+ public static void setImageResourceId(int imageResource) {
+ mImageResource = imageResource;
}
public void setListener(OnPreferenceChangedListener listener) {
diff --git a/src/com/android/camera/ui/IndicatorControlBarContainer.java b/src/com/android/camera/ui/IndicatorControlBarContainer.java
index 311615b..3695d56 100644
--- a/src/com/android/camera/ui/IndicatorControlBarContainer.java
+++ b/src/com/android/camera/ui/IndicatorControlBarContainer.java
@@ -47,15 +47,14 @@ public class IndicatorControlBarContainer extends IndicatorControl implements
public void initialize(Context context, PreferenceGroup group,
String flashSetting, String[] secondLevelKeys,
String[] secondLevelOtherSettingKeys) {
- mIndicatorControlBar = (IndicatorControlBar)
- findViewById(R.id.indicator_bar);
-
mZoomControlBar = (ZoomControlBar)
findViewById(R.id.zoom_control);
mZoomControlBar.setOnIndicatorEventListener(this);
// We need to show/hide the zoom slider icon accordingly.
// From UI spec, we have camera_flash setting on the first level.
+ mIndicatorControlBar = (IndicatorControlBar)
+ findViewById(R.id.indicator_bar);
mIndicatorControlBar.initialize(context, group, flashSetting,
mZoomControlBar.isZoomSupported());
mIndicatorControlBar.setOnIndicatorEventListener(this);
diff --git a/src/com/android/camera/ui/IndicatorControlWheel.java b/src/com/android/camera/ui/IndicatorControlWheel.java
index 20f4b9b..e432f6d 100644
--- a/src/com/android/camera/ui/IndicatorControlWheel.java
+++ b/src/com/android/camera/ui/IndicatorControlWheel.java
@@ -155,7 +155,10 @@ public class IndicatorControlWheel extends IndicatorControl implements
// Add first-level controls.
super.initialize(context, group, new String[] {flashSetting}, null);
+
+ // Add CameraPicker control.
initializeCameraPicker();
+
// Add second-level Indicator Icon.
mSecondLevelIcon = addImageButton(context, R.drawable.ic_settings_holo_light, true);
mSecondLevelStartIndex = getChildCount();