summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAngus Kong <shkong@google.com>2011-11-07 11:33:31 +0800
committerAngus Kong <shkong@google.com>2011-11-07 16:15:45 +0800
commitc12e12365fc3b0b3b4718eced8f3dc6a776c0851 (patch)
treee9a4af8debd75a371abc060663c8a9fb01d9db97 /src
parent781528e1c86aa16d72694510898325d65e32c35b (diff)
downloadLegacyCamera-c12e12365fc3b0b3b4718eced8f3dc6a776c0851.zip
LegacyCamera-c12e12365fc3b0b3b4718eced8f3dc6a776c0851.tar.gz
LegacyCamera-c12e12365fc3b0b3b4718eced8f3dc6a776c0851.tar.bz2
Make 40% opacity for disabled indicators.
bug:5521011 Change-Id: I150f754b9190e7034e75a3ab06cb0f5e8312cd31
Diffstat (limited to 'src')
-rw-r--r--src/com/android/camera/ui/IndicatorControlWheel.java2
-rw-r--r--src/com/android/camera/ui/RotateImageView.java2
-rw-r--r--src/com/android/camera/ui/TwoStateImageView.java (renamed from src/com/android/camera/ui/ColorFilterImageView.java)15
3 files changed, 9 insertions, 10 deletions
diff --git a/src/com/android/camera/ui/IndicatorControlWheel.java b/src/com/android/camera/ui/IndicatorControlWheel.java
index 3b8bea4..92f658a 100644
--- a/src/com/android/camera/ui/IndicatorControlWheel.java
+++ b/src/com/android/camera/ui/IndicatorControlWheel.java
@@ -187,7 +187,7 @@ public class IndicatorControlWheel extends IndicatorControl implements
if (rotatable) {
view = new RotateImageView(context);
} else {
- view = new ColorFilterImageView(context);
+ view = new TwoStateImageView(context);
}
view.setImageResource(resourceId);
view.setOnClickListener(this);
diff --git a/src/com/android/camera/ui/RotateImageView.java b/src/com/android/camera/ui/RotateImageView.java
index f47a26b..39c4df2 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 ColorFilterImageView implements Rotatable {
+public class RotateImageView extends TwoStateImageView implements Rotatable {
@SuppressWarnings("unused")
private static final String TAG = "RotateImageView";
diff --git a/src/com/android/camera/ui/ColorFilterImageView.java b/src/com/android/camera/ui/TwoStateImageView.java
index 56bef82..beb6bf5 100644
--- a/src/com/android/camera/ui/ColorFilterImageView.java
+++ b/src/com/android/camera/ui/TwoStateImageView.java
@@ -23,18 +23,17 @@ import android.util.AttributeSet;
import android.widget.ImageView;
/**
- * A @{code ImageView} which grey out the icon if disabled.
+ * A @{code ImageView} which change the opacity of the icon if disabled.
*/
-public class ColorFilterImageView extends ImageView {
- private final int DISABLED_COLOR;
+public class TwoStateImageView extends ImageView {
+ private final float DISABLED_ALPHA = 0.4f;
private boolean mFilterEnabled = true;
- public ColorFilterImageView(Context context, AttributeSet attrs) {
+ public TwoStateImageView(Context context, AttributeSet attrs) {
super(context, attrs);
- DISABLED_COLOR = context.getResources().getColor(R.color.icon_disabled_color);
}
- public ColorFilterImageView(Context context) {
+ public TwoStateImageView(Context context) {
this(context, null);
}
@@ -43,9 +42,9 @@ public class ColorFilterImageView extends ImageView {
super.setEnabled(enabled);
if (mFilterEnabled) {
if (enabled) {
- clearColorFilter();
+ setAlpha(1.0f);
} else {
- setColorFilter(DISABLED_COLOR);
+ setAlpha(DISABLED_ALPHA);
}
}
}