summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChih-yu Huang <akahuang@google.com>2011-08-26 05:13:35 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-08-26 05:13:35 -0700
commit11bd0b3d63423c800050d4ff9b1f759ceb25f08c (patch)
tree45d5e009071c1ba4ecb899522d78323c8ee27c16 /src
parent7fa062ee44a5f8a2401bd4b7147c2ca363abb5dd (diff)
parent0935e09bb12a1886a801713bbd78bbc20bf4ea4e (diff)
downloadLegacyCamera-11bd0b3d63423c800050d4ff9b1f759ceb25f08c.zip
LegacyCamera-11bd0b3d63423c800050d4ff9b1f759ceb25f08c.tar.gz
LegacyCamera-11bd0b3d63423c800050d4ff9b1f759ceb25f08c.tar.bz2
Merge "Change front/back switcher icon in camera mode"
Diffstat (limited to 'src')
-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
5 files changed, 18 insertions, 4 deletions
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();