diff options
author | Chih-yu Huang <akahuang@google.com> | 2011-08-23 15:31:36 +0800 |
---|---|---|
committer | Chih-yu Huang <akahuang@google.com> | 2011-08-26 19:52:20 +0800 |
commit | 0935e09bb12a1886a801713bbd78bbc20bf4ea4e (patch) | |
tree | cdfcc46510097d40f93b395862c33c550171dbf3 | |
parent | 6f6ea6ab6dad370d2cc378be91a2649ae44b2c94 (diff) | |
download | packages_apps_LegacyCamera-0935e09bb12a1886a801713bbd78bbc20bf4ea4e.zip packages_apps_LegacyCamera-0935e09bb12a1886a801713bbd78bbc20bf4ea4e.tar.gz packages_apps_LegacyCamera-0935e09bb12a1886a801713bbd78bbc20bf4ea4e.tar.bz2 |
Change front/back switcher icon in camera mode
bug:5198658
Change-Id: I4a0f91f9318313c219904c3417fbf98a256cfac3
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 Binary files differdeleted file mode 100644 index c76c064..0000000 --- a/res/drawable-hdpi/ic_switch_camera_facing_holo_light.png +++ /dev/null diff --git a/res/drawable-hdpi/ic_switch_photo_facing_holo_light.png b/res/drawable-hdpi/ic_switch_photo_facing_holo_light.png Binary files differnew file mode 100644 index 0000000..ea65607 --- /dev/null +++ b/res/drawable-hdpi/ic_switch_photo_facing_holo_light.png diff --git a/res/drawable-hdpi/ic_switch_video_facing_holo_light.png b/res/drawable-hdpi/ic_switch_video_facing_holo_light.png Binary files differnew file mode 100644 index 0000000..3176041 --- /dev/null +++ b/res/drawable-hdpi/ic_switch_video_facing_holo_light.png diff --git a/res/drawable-mdpi/ic_switch_camera_facing_holo_light.png b/res/drawable-mdpi/ic_switch_camera_facing_holo_light.png Binary files differdeleted file mode 100644 index fe2ccaf..0000000 --- a/res/drawable-mdpi/ic_switch_camera_facing_holo_light.png +++ /dev/null diff --git a/res/drawable-mdpi/ic_switch_photo_facing_holo_light.png b/res/drawable-mdpi/ic_switch_photo_facing_holo_light.png Binary files differnew file mode 100644 index 0000000..47726c0 --- /dev/null +++ b/res/drawable-mdpi/ic_switch_photo_facing_holo_light.png diff --git a/res/drawable-mdpi/ic_switch_video_facing_holo_light.png b/res/drawable-mdpi/ic_switch_video_facing_holo_light.png Binary files differnew file mode 100644 index 0000000..48b85c9 --- /dev/null +++ b/res/drawable-mdpi/ic_switch_video_facing_holo_light.png 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 Binary files differnew file mode 100644 index 0000000..b73a52a --- /dev/null +++ b/res/drawable-w1024dp-hdpi/ic_switch_photo_facing_holo_light.png 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 Binary files differindex 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 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 Binary files differnew file mode 100644 index 0000000..566b5fc --- /dev/null +++ b/res/drawable-w1024dp-mdpi/ic_switch_photo_facing_holo_light.png 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 Binary files differindex 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 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 Binary files differnew file mode 100644 index 0000000..d6b4f81 --- /dev/null +++ b/res/drawable-w1024dp-xhdpi/ic_switch_photo_facing_holo_light.png 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 Binary files differindex 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 diff --git a/res/drawable-xhdpi/ic_switch_camera_facing_holo_light.png b/res/drawable-xhdpi/ic_switch_camera_facing_holo_light.png Binary files differdeleted file mode 100644 index 913b3be..0000000 --- a/res/drawable-xhdpi/ic_switch_camera_facing_holo_light.png +++ /dev/null diff --git a/res/drawable-xhdpi/ic_switch_photo_facing_holo_light.png b/res/drawable-xhdpi/ic_switch_photo_facing_holo_light.png Binary files differnew file mode 100644 index 0000000..3b44928 --- /dev/null +++ b/res/drawable-xhdpi/ic_switch_photo_facing_holo_light.png diff --git a/res/drawable-xhdpi/ic_switch_video_facing_holo_light.png b/res/drawable-xhdpi/ic_switch_video_facing_holo_light.png Binary files differnew file mode 100644 index 0000000..9ef6f34 --- /dev/null +++ b/res/drawable-xhdpi/ic_switch_video_facing_holo_light.png 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(); |