summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChung-yih Wang <cywang@google.com>2011-09-02 19:52:43 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-09-02 19:52:43 -0700
commitf6de2b4114de0355581a666cde86c3351b851417 (patch)
treecff4269b2c864ae467d2eae74d4031775c8f2ebb
parent364ac94ce918501f02ace9f6aeb3744fccd95275 (diff)
parentb1ce29490ec61847602ece16f3745417787d3d8f (diff)
downloadpackages_apps_LegacyCamera-f6de2b4114de0355581a666cde86c3351b851417.zip
packages_apps_LegacyCamera-f6de2b4114de0355581a666cde86c3351b851417.tar.gz
packages_apps_LegacyCamera-f6de2b4114de0355581a666cde86c3351b851417.tar.bz2
Merge "Add the missing setEnabled() for phone UI controls."
-rw-r--r--res/layout/indicator_bar.xml2
-rw-r--r--res/xml/camera_preferences.xml112
-rw-r--r--res/xml/video_preferences.xml94
-rw-r--r--src/com/android/camera/ui/AbstractIndicatorButton.java7
-rw-r--r--src/com/android/camera/ui/CameraPicker.java12
-rw-r--r--src/com/android/camera/ui/ColorFilterImageView.java49
-rw-r--r--src/com/android/camera/ui/IndicatorControl.java21
-rw-r--r--src/com/android/camera/ui/IndicatorControlBar.java12
-rw-r--r--src/com/android/camera/ui/IndicatorControlBarContainer.java6
-rw-r--r--src/com/android/camera/ui/IndicatorControlWheel.java23
-rw-r--r--src/com/android/camera/ui/RotateImageView.java2
-rw-r--r--src/com/android/camera/ui/SecondLevelIndicatorControlBar.java11
12 files changed, 214 insertions, 137 deletions
diff --git a/res/layout/indicator_bar.xml b/res/layout/indicator_bar.xml
index 359b4ad..0d5cb78 100644
--- a/res/layout/indicator_bar.xml
+++ b/res/layout/indicator_bar.xml
@@ -45,7 +45,7 @@
android:layout_centerHorizontal="true"
android:layout_width="48dp"
android:layout_height="match_parent">
- <ImageView
+ <com.android.camera.ui.ColorFilterImageView
android:id="@+id/zoom_control_icon"
android:layout_width="match_parent"
android:layout_height="wrap_content"
diff --git a/res/xml/camera_preferences.xml b/res/xml/camera_preferences.xml
index c7a1d90..aa1882f 100644
--- a/res/xml/camera_preferences.xml
+++ b/res/xml/camera_preferences.xml
@@ -15,61 +15,59 @@
-->
<PreferenceGroup
- xmlns:camera="http://schemas.android.com/apk/res/com.android.camera" >
- <PreferenceGroup
- camera:title="@string/pref_camera_settings_category">
- <IconListPreference
- camera:key="pref_camera_flashmode_key"
- camera:defaultValue="@string/pref_camera_flashmode_default"
- camera:title="@string/pref_camera_flashmode_title"
- camera:icons="@array/camera_flashmode_icons"
- camera:largeIcons="@array/camera_flashmode_largeicons"
- camera:entries="@array/pref_camera_flashmode_entries"
- camera:entryValues="@array/pref_camera_flashmode_entryvalues" />
- <ListPreference
- camera:key="pref_camera_exposure_key"
- camera:defaultValue="@string/pref_exposure_default"
- camera:title="@string/pref_exposure_title" />
- <IconListPreference
- camera:key="pref_camera_scenemode_key"
- camera:defaultValue="@string/pref_camera_scenemode_default"
- camera:title="@string/pref_camera_scenemode_title"
- camera:singleIcon="@drawable/ic_viewfinder_scene_mode"
- camera:entries="@array/pref_camera_scenemode_entries"
- camera:entryValues="@array/pref_camera_scenemode_entryvalues" />
- <IconListPreference
- camera:key="pref_camera_whitebalance_key"
- camera:defaultValue="@string/pref_camera_whitebalance_default"
- camera:title="@string/pref_camera_whitebalance_title"
- camera:icons="@array/whitebalance_icons"
- camera:largeIcons="@array/whitebalance_largeicons"
- camera:entries="@array/pref_camera_whitebalance_entries"
- camera:entryValues="@array/pref_camera_whitebalance_entryvalues" />
- <RecordLocationPreference
- camera:key="pref_camera_recordlocation_key"
- camera:defaultValue="@string/pref_camera_recordlocation_default"
- camera:title="@string/pref_camera_recordlocation_title"
- camera:icons="@array/camera_recordlocation_icons"
- camera:largeIcons="@array/camera_recordlocation_largeicons"
- camera:entries="@array/pref_camera_recordlocation_entries"
- camera:entryValues="@array/pref_camera_recordlocation_entryvalues" />
- <ListPreference
- camera:key="pref_camera_picturesize_key"
- camera:title="@string/pref_camera_picturesize_title"
- camera:entries="@array/pref_camera_picturesize_entries"
- camera:entryValues="@array/pref_camera_picturesize_entryvalues" />
- <ListPreference
- camera:key="pref_camera_focusmode_key"
- camera:defaultValue="@string/pref_camera_focusmode_default"
- camera:title="@string/pref_camera_focusmode_title"
- camera:entries="@array/pref_camera_focusmode_entries"
- camera:entryValues="@array/pref_camera_focusmode_entryvalues" />
- <IconListPreference
- camera:key="pref_camera_id_key"
- camera:defaultValue="@string/pref_camera_id_default"
- camera:title="@string/pref_camera_id_title"
- camera:icons="@array/camera_id_icons"
- camera:entries="@array/camera_id_entries"
- camera:largeIcons="@array/camera_id_largeicons" />
- </PreferenceGroup>
+ xmlns:camera="http://schemas.android.com/apk/res/com.android.camera"
+ camera:title="@string/pref_camera_settings_category">
+ <IconListPreference
+ camera:key="pref_camera_flashmode_key"
+ camera:defaultValue="@string/pref_camera_flashmode_default"
+ camera:title="@string/pref_camera_flashmode_title"
+ camera:icons="@array/camera_flashmode_icons"
+ camera:largeIcons="@array/camera_flashmode_largeicons"
+ camera:entries="@array/pref_camera_flashmode_entries"
+ camera:entryValues="@array/pref_camera_flashmode_entryvalues" />
+ <ListPreference
+ camera:key="pref_camera_exposure_key"
+ camera:defaultValue="@string/pref_exposure_default"
+ camera:title="@string/pref_exposure_title" />
+ <IconListPreference
+ camera:key="pref_camera_scenemode_key"
+ camera:defaultValue="@string/pref_camera_scenemode_default"
+ camera:title="@string/pref_camera_scenemode_title"
+ camera:singleIcon="@drawable/ic_viewfinder_scene_mode"
+ camera:entries="@array/pref_camera_scenemode_entries"
+ camera:entryValues="@array/pref_camera_scenemode_entryvalues" />
+ <IconListPreference
+ camera:key="pref_camera_whitebalance_key"
+ camera:defaultValue="@string/pref_camera_whitebalance_default"
+ camera:title="@string/pref_camera_whitebalance_title"
+ camera:icons="@array/whitebalance_icons"
+ camera:largeIcons="@array/whitebalance_largeicons"
+ camera:entries="@array/pref_camera_whitebalance_entries"
+ camera:entryValues="@array/pref_camera_whitebalance_entryvalues" />
+ <RecordLocationPreference
+ camera:key="pref_camera_recordlocation_key"
+ camera:defaultValue="@string/pref_camera_recordlocation_default"
+ camera:title="@string/pref_camera_recordlocation_title"
+ camera:icons="@array/camera_recordlocation_icons"
+ camera:largeIcons="@array/camera_recordlocation_largeicons"
+ camera:entries="@array/pref_camera_recordlocation_entries"
+ camera:entryValues="@array/pref_camera_recordlocation_entryvalues" />
+ <ListPreference
+ camera:key="pref_camera_picturesize_key"
+ camera:title="@string/pref_camera_picturesize_title"
+ camera:entries="@array/pref_camera_picturesize_entries"
+ camera:entryValues="@array/pref_camera_picturesize_entryvalues" />
+ <ListPreference
+ camera:key="pref_camera_focusmode_key"
+ camera:defaultValue="@string/pref_camera_focusmode_default"
+ camera:title="@string/pref_camera_focusmode_title"
+ camera:entries="@array/pref_camera_focusmode_entries"
+ camera:entryValues="@array/pref_camera_focusmode_entryvalues" />
+ <IconListPreference
+ camera:key="pref_camera_id_key"
+ camera:defaultValue="@string/pref_camera_id_default"
+ camera:title="@string/pref_camera_id_title"
+ camera:icons="@array/camera_id_icons"
+ camera:entries="@array/camera_id_entries"
+ camera:largeIcons="@array/camera_id_largeicons" />
</PreferenceGroup>
diff --git a/res/xml/video_preferences.xml b/res/xml/video_preferences.xml
index 031e416..847b581 100644
--- a/res/xml/video_preferences.xml
+++ b/res/xml/video_preferences.xml
@@ -15,52 +15,50 @@
-->
<PreferenceGroup
- xmlns:camera="http://schemas.android.com/apk/res/com.android.camera" >
- <PreferenceGroup
- camera:title="@string/pref_camcorder_settings_category">
- <IconListPreference
- camera:key="pref_video_quality_key"
- camera:defaultValue="@string/pref_video_quality_default"
- camera:title="@string/pref_video_quality_title"
- camera:largeIcons="@array/video_quality_largeicons"
- camera:entries="@array/pref_video_quality_entries"
- camera:entryValues="@array/pref_video_quality_entryvalues"/>
- <IconListPreference
- camera:key="pref_video_time_lapse_frame_interval_key"
- camera:defaultValue="@string/pref_video_time_lapse_frame_interval_default"
- camera:title="@string/pref_video_time_lapse_frame_interval_title"
- camera:singleIcon="@drawable/ic_time_lapse_holo_dark"
- camera:entries="@array/pref_video_time_lapse_frame_interval_entries"
- camera:entryValues="@array/pref_video_time_lapse_frame_interval_entryvalues"/>
- <IconListPreference
- camera:key="pref_camera_video_flashmode_key"
- camera:defaultValue="@string/pref_camera_video_flashmode_default"
- camera:title="@string/pref_camera_flashmode_title"
- camera:icons="@array/video_flashmode_icons"
- camera:largeIcons="@array/video_flashmode_largeicons"
- camera:entries="@array/pref_camera_video_flashmode_entries"
- camera:entryValues="@array/pref_camera_video_flashmode_entryvalues"/>
- <IconListPreference
- camera:key="pref_camera_whitebalance_key"
- camera:defaultValue="@string/pref_camera_whitebalance_default"
- camera:title="@string/pref_camera_whitebalance_title"
- camera:icons="@array/whitebalance_icons"
- camera:largeIcons="@array/whitebalance_largeicons"
- camera:entries="@array/pref_camera_whitebalance_entries"
- camera:entryValues="@array/pref_camera_whitebalance_entryvalues"/>
- <IconListPreference
- camera:key="pref_camera_id_key"
- camera:defaultValue="@string/pref_camera_id_default"
- camera:title="@string/pref_camera_id_title"
- camera:icons="@array/camera_id_icons"
- camera:entries="@array/camera_id_entries"
- camera:largeIcons="@array/camera_id_largeicons"/>
- <IconListPreference
- camera:key="pref_video_effect_key"
- camera:defaultValue="@string/pref_video_effect_default"
- camera:title="@string/pref_video_effect_title"
- camera:singleIcon="@drawable/ic_effects_holo_light"
- camera:entries="@array/pref_video_effect_entries"
- camera:entryValues="@array/pref_video_effect_entryvalues" />
- </PreferenceGroup>
+ xmlns:camera="http://schemas.android.com/apk/res/com.android.camera"
+ camera:title="@string/pref_camcorder_settings_category">
+ <IconListPreference
+ camera:key="pref_video_quality_key"
+ camera:defaultValue="@string/pref_video_quality_default"
+ camera:title="@string/pref_video_quality_title"
+ camera:largeIcons="@array/video_quality_largeicons"
+ camera:entries="@array/pref_video_quality_entries"
+ camera:entryValues="@array/pref_video_quality_entryvalues"/>
+ <IconListPreference
+ camera:key="pref_video_time_lapse_frame_interval_key"
+ camera:defaultValue="@string/pref_video_time_lapse_frame_interval_default"
+ camera:title="@string/pref_video_time_lapse_frame_interval_title"
+ camera:singleIcon="@drawable/ic_time_lapse_holo_dark"
+ camera:entries="@array/pref_video_time_lapse_frame_interval_entries"
+ camera:entryValues="@array/pref_video_time_lapse_frame_interval_entryvalues"/>
+ <IconListPreference
+ camera:key="pref_camera_video_flashmode_key"
+ camera:defaultValue="@string/pref_camera_video_flashmode_default"
+ camera:title="@string/pref_camera_flashmode_title"
+ camera:icons="@array/video_flashmode_icons"
+ camera:largeIcons="@array/video_flashmode_largeicons"
+ camera:entries="@array/pref_camera_video_flashmode_entries"
+ camera:entryValues="@array/pref_camera_video_flashmode_entryvalues"/>
+ <IconListPreference
+ camera:key="pref_camera_whitebalance_key"
+ camera:defaultValue="@string/pref_camera_whitebalance_default"
+ camera:title="@string/pref_camera_whitebalance_title"
+ camera:icons="@array/whitebalance_icons"
+ camera:largeIcons="@array/whitebalance_largeicons"
+ camera:entries="@array/pref_camera_whitebalance_entries"
+ camera:entryValues="@array/pref_camera_whitebalance_entryvalues"/>
+ <IconListPreference
+ camera:key="pref_camera_id_key"
+ camera:defaultValue="@string/pref_camera_id_default"
+ camera:title="@string/pref_camera_id_title"
+ camera:icons="@array/camera_id_icons"
+ camera:entries="@array/camera_id_entries"
+ camera:largeIcons="@array/camera_id_largeicons"/>
+ <IconListPreference
+ camera:key="pref_video_effect_key"
+ camera:defaultValue="@string/pref_video_effect_default"
+ camera:title="@string/pref_video_effect_title"
+ camera:singleIcon="@drawable/ic_effects_holo_light"
+ camera:entries="@array/pref_video_effect_entries"
+ camera:entryValues="@array/pref_video_effect_entryvalues" />
</PreferenceGroup>
diff --git a/src/com/android/camera/ui/AbstractIndicatorButton.java b/src/com/android/camera/ui/AbstractIndicatorButton.java
index 311a3f5..aa632f7 100644
--- a/src/com/android/camera/ui/AbstractIndicatorButton.java
+++ b/src/com/android/camera/ui/AbstractIndicatorButton.java
@@ -33,7 +33,6 @@ public abstract class AbstractIndicatorButton extends RotateImageView {
protected Context mContext;
protected Animation mFadeIn, mFadeOut;
protected final int HIGHLIGHT_COLOR;
- protected final int DISABLED_COLOR;
protected AbstractSettingPopup mPopup;
protected Handler mHandler = new MainHandler();
private final int MSG_DISMISS_POPUP = 0;
@@ -44,7 +43,6 @@ public abstract class AbstractIndicatorButton extends RotateImageView {
mFadeIn = AnimationUtils.loadAnimation(mContext, R.anim.grow_fade_in_from_right);
mFadeOut = AnimationUtils.loadAnimation(mContext, R.anim.shrink_fade_out_from_right);
HIGHLIGHT_COLOR = mContext.getResources().getColor(R.color.review_control_pressed_color);
- DISABLED_COLOR = mContext.getResources().getColor(R.color.icon_disabled_color);
setScaleType(ImageView.ScaleType.CENTER);
}
@@ -86,11 +84,6 @@ public abstract class AbstractIndicatorButton extends RotateImageView {
// the "highlight" state.
if (isEnabled() ^ enabled) {
super.setEnabled(enabled);
- if (enabled) {
- clearColorFilter();
- } else {
- setColorFilter(DISABLED_COLOR);
- }
}
}
diff --git a/src/com/android/camera/ui/CameraPicker.java b/src/com/android/camera/ui/CameraPicker.java
index a3fa352..78e2b27 100644
--- a/src/com/android/camera/ui/CameraPicker.java
+++ b/src/com/android/camera/ui/CameraPicker.java
@@ -34,11 +34,9 @@ public class CameraPicker extends RotateImageView implements View.OnClickListene
private ListPreference mPreference;
private CharSequence[] mCameras;
private int mCameraFacing;
- private final int DISABLED_COLOR;
public CameraPicker(Context context) {
super(context);
- DISABLED_COLOR = context.getResources().getColor(R.color.icon_disabled_color);
setImageResource(mImageResource);
}
@@ -74,14 +72,4 @@ public class CameraPicker extends RotateImageView implements View.OnClickListene
mPreference.setValue((String) mCameras[mCameraFacing]);
mListener.onSharedPreferenceChanged();
}
-
- @Override
- public void setEnabled(boolean enabled) {
- super.setEnabled(enabled);
- if (enabled) {
- clearColorFilter();
- } else {
- setColorFilter(DISABLED_COLOR);
- }
- }
}
diff --git a/src/com/android/camera/ui/ColorFilterImageView.java b/src/com/android/camera/ui/ColorFilterImageView.java
new file mode 100644
index 0000000..bce7809
--- /dev/null
+++ b/src/com/android/camera/ui/ColorFilterImageView.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.camera.ui;
+
+import com.android.camera.R;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.widget.ImageView;
+
+/**
+ * A @{code ImageView} which grey out the icon if disabled.
+ */
+public class ColorFilterImageView extends ImageView {
+ private int DISABLED_COLOR;
+
+ public ColorFilterImageView(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ DISABLED_COLOR = context.getResources().getColor(R.color.icon_disabled_color);
+ }
+
+ public ColorFilterImageView(Context context) {
+ this(context, null);
+ }
+
+ @Override
+ public void setEnabled(boolean enabled) {
+ super.setEnabled(enabled);
+ if (enabled) {
+ clearColorFilter();
+ } else {
+ setColorFilter(DISABLED_COLOR);
+ }
+ }
+}
diff --git a/src/com/android/camera/ui/IndicatorControl.java b/src/com/android/camera/ui/IndicatorControl.java
index 2dd8777..78d51c1 100644
--- a/src/com/android/camera/ui/IndicatorControl.java
+++ b/src/com/android/camera/ui/IndicatorControl.java
@@ -37,6 +37,8 @@ import java.util.ArrayList;
public abstract class IndicatorControl extends RelativeLayout implements
IndicatorButton.Listener, OtherSettingsPopup.Listener {
private static final String TAG = "IndicatorControl";
+ public static final int MODE_CAMERA = 0;
+ public static final int MODE_VIDEO = 1;
private Context mContext;
private OnPreferenceChangedListener mListener;
@@ -46,6 +48,8 @@ public abstract class IndicatorControl extends RelativeLayout implements
private PreferenceGroup mPreferenceGroup;
private int mDegree = 0;
+ protected int mCurrentMode = MODE_CAMERA;
+
ArrayList<AbstractIndicatorButton> mIndicators =
new ArrayList<AbstractIndicatorButton>();
@@ -76,6 +80,12 @@ public abstract class IndicatorControl extends RelativeLayout implements
public void setPreferenceGroup(PreferenceGroup group) {
mPreferenceGroup = group;
+ // Preset the current mode from the title of preference group.
+ String title = group.getTitle();
+ if (title.equals(mContext.getString(
+ R.string.pref_camcorder_settings_category))) {
+ mCurrentMode = MODE_VIDEO;
+ }
}
protected void addControls(String[] keys, String[] otherSettingKeys) {
@@ -186,8 +196,17 @@ public abstract class IndicatorControl extends RelativeLayout implements
// Zoom buttons and shutter button are controlled by the activity.
if (v instanceof AbstractIndicatorButton) {
v.setEnabled(enabled);
+ // Show or hide the indicator buttons during recording.
+ if (mCurrentMode == MODE_VIDEO) {
+ v.setVisibility(enabled ? View.VISIBLE : View.INVISIBLE);
+ }
+ }
+ }
+ if (mCameraPicker != null) {
+ mCameraPicker.setEnabled(enabled);
+ if (mCurrentMode == MODE_VIDEO) {
+ mCameraPicker.setVisibility(enabled ? View.VISIBLE : View.INVISIBLE);
}
}
- if (mCameraPicker != null) mCameraPicker.setEnabled(enabled);
}
}
diff --git a/src/com/android/camera/ui/IndicatorControlBar.java b/src/com/android/camera/ui/IndicatorControlBar.java
index ed47f96..773645f 100644
--- a/src/com/android/camera/ui/IndicatorControlBar.java
+++ b/src/com/android/camera/ui/IndicatorControlBar.java
@@ -103,4 +103,16 @@ public class IndicatorControlBar extends IndicatorControl implements
}
if (mCameraPicker != null) mCameraPicker.layout(0, offset, width, offset + width);
}
+
+ @Override
+ public void setEnabled(boolean enabled) {
+ super.setEnabled(enabled);
+ if (mCurrentMode == MODE_VIDEO) {
+ mSecondLevelIcon.setVisibility(enabled ? View.VISIBLE : View.INVISIBLE);
+ } else {
+ // We also disable the zoom button during snapshot.
+ if (mZoomIcon != null) mZoomIcon.setEnabled(enabled);
+ }
+ mSecondLevelIcon.setEnabled(enabled);
+ }
}
diff --git a/src/com/android/camera/ui/IndicatorControlBarContainer.java b/src/com/android/camera/ui/IndicatorControlBarContainer.java
index 56e887d..0783065 100644
--- a/src/com/android/camera/ui/IndicatorControlBarContainer.java
+++ b/src/com/android/camera/ui/IndicatorControlBarContainer.java
@@ -158,4 +158,10 @@ public class IndicatorControlBarContainer extends IndicatorControlContainer
mSecondLevelIndicatorControlBar.overrideSettings(keyvalues);
}
}
+
+ @Override
+ public void setEnabled(boolean enabled) {
+ mIndicatorControlBar.setEnabled(enabled);
+ mSecondLevelIndicatorControlBar.setEnabled(enabled);
+ }
}
diff --git a/src/com/android/camera/ui/IndicatorControlWheel.java b/src/com/android/camera/ui/IndicatorControlWheel.java
index 8d37b19..9279cc2 100644
--- a/src/com/android/camera/ui/IndicatorControlWheel.java
+++ b/src/com/android/camera/ui/IndicatorControlWheel.java
@@ -88,7 +88,6 @@ public class IndicatorControlWheel extends IndicatorControl implements
// Remember the last event for event cancelling if out of bound.
private MotionEvent mLastMotionEvent;
- protected final int DISABLED_COLOR;
private ImageView mSecondLevelIcon;
private ImageView mCloseIcon;
@@ -110,7 +109,7 @@ public class IndicatorControlWheel extends IndicatorControl implements
private double mSectorRadians[] = new double[2];
private double mTouchSectorRadians[] = new double[2];
- private View mZoomIcon;
+ private ImageView mZoomIcon;
public IndicatorControlWheel(Context context, AttributeSet attrs) {
super(context, attrs);
@@ -125,7 +124,6 @@ public class IndicatorControlWheel extends IndicatorControl implements
mBackgroundPaint.setAntiAlias(true);
mBackgroundRect = new RectF();
- DISABLED_COLOR = context.getResources().getColor(R.color.icon_disabled_color);
}
private int getChildCountByLevel(int level) {
@@ -182,7 +180,12 @@ public class IndicatorControlWheel extends IndicatorControl implements
}
private ImageView addImageButton(Context context, int resourceId, boolean rotatable) {
- ImageView view = rotatable ? new RotateImageView(context) : new ImageView(context);
+ ImageView view;
+ if (rotatable) {
+ view = new RotateImageView(context);
+ } else {
+ view = new ColorFilterImageView(context);
+ }
view.setImageResource(resourceId);
view.setOnClickListener(this);
addView(view);
@@ -309,6 +312,7 @@ public class IndicatorControlWheel extends IndicatorControl implements
// The icons are spreaded on the left side of the shutter button.
for (int i = 0; i < getChildCount(); ++i) {
View view = getChildAt(i);
+ if (!view.isEnabled()) continue;
double radian = mChildRadians[i];
double startVisibleRadians = mInAnimation
? mStartVisibleRadians[1]
@@ -467,12 +471,13 @@ public class IndicatorControlWheel extends IndicatorControl implements
@Override
public void setEnabled(boolean enabled) {
super.setEnabled(enabled);
- if (enabled) {
- mSecondLevelIcon.clearColorFilter();
- mCloseIcon.clearColorFilter();
+ if (mCurrentMode == MODE_VIDEO) {
+ mSecondLevelIcon.setVisibility(enabled ? View.VISIBLE : View.INVISIBLE);
+ mCloseIcon.setVisibility(enabled ? View.VISIBLE : View.INVISIBLE);
+ requestLayout();
} else {
- mSecondLevelIcon.setColorFilter(DISABLED_COLOR);
- mCloseIcon.setColorFilter(DISABLED_COLOR);
+ // We also disable the zoom button during snapshot.
+ if (mZoomIcon != null) mZoomIcon.setEnabled(enabled);
}
mSecondLevelIcon.setEnabled(enabled);
mCloseIcon.setEnabled(enabled);
diff --git a/src/com/android/camera/ui/RotateImageView.java b/src/com/android/camera/ui/RotateImageView.java
index c58d0c9..81faaec 100644
--- a/src/com/android/camera/ui/RotateImageView.java
+++ b/src/com/android/camera/ui/RotateImageView.java
@@ -32,7 +32,7 @@ import android.widget.ImageView;
/**
* A @{code ImageView} which can rotate it's content.
*/
-public class RotateImageView extends ImageView {
+public class RotateImageView extends ColorFilterImageView {
@SuppressWarnings("unused")
private static final String TAG = "RotateImageView";
diff --git a/src/com/android/camera/ui/SecondLevelIndicatorControlBar.java b/src/com/android/camera/ui/SecondLevelIndicatorControlBar.java
index 5ce586e..b725002 100644
--- a/src/com/android/camera/ui/SecondLevelIndicatorControlBar.java
+++ b/src/com/android/camera/ui/SecondLevelIndicatorControlBar.java
@@ -43,7 +43,7 @@ public class SecondLevelIndicatorControlBar extends IndicatorControl implements
public void initialize(Context context, PreferenceGroup group,
String[] keys, String[] otherSettingKeys) {
if (mCloseIcon == null) {
- mCloseIcon = new ImageView(context);
+ mCloseIcon = new ColorFilterImageView(context);
mCloseIcon.setImageResource(R.drawable.btn_close_settings);
mCloseIcon.setOnClickListener(this);
addView(mCloseIcon);
@@ -112,4 +112,13 @@ public class SecondLevelIndicatorControlBar extends IndicatorControl implements
top + i * height / count + h);
}
}
+
+ @Override
+ public void setEnabled(boolean enabled) {
+ super.setEnabled(enabled);
+ if (mCurrentMode == MODE_VIDEO) {
+ mCloseIcon.setVisibility(enabled ? View.VISIBLE : View.INVISIBLE);
+ }
+ mCloseIcon.setEnabled(enabled);
+ }
}