diff options
Diffstat (limited to 'src/com/android/camera/ui')
-rw-r--r-- | src/com/android/camera/ui/IndicatorControlWheel.java | 2 | ||||
-rw-r--r-- | src/com/android/camera/ui/RotateImageView.java | 2 | ||||
-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); } } } |