diff options
| -rw-r--r-- | res/layout/indicator_bar.xml | 2 | ||||
| -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 |
4 files changed, 10 insertions, 11 deletions
diff --git a/res/layout/indicator_bar.xml b/res/layout/indicator_bar.xml index 33a8c7a..b7348b4 100644 --- a/res/layout/indicator_bar.xml +++ b/res/layout/indicator_bar.xml @@ -63,7 +63,7 @@ android:layout_width="0dp" android:background="@color/mode_selection_border" android:visibility="gone" /> - <com.android.camera.ui.ColorFilterImageView + <com.android.camera.ui.TwoStateImageView android:id="@+id/back_to_first_level" android:layout_height="match_parent" android:layout_width="wrap_content" 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); } } } |
