diff options
-rw-r--r-- | src/com/android/camera/ui/CameraPicker.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/com/android/camera/ui/CameraPicker.java b/src/com/android/camera/ui/CameraPicker.java index 8b4596a..a3fa352 100644 --- a/src/com/android/camera/ui/CameraPicker.java +++ b/src/com/android/camera/ui/CameraPicker.java @@ -23,7 +23,6 @@ import com.android.camera.R; import android.content.Context; import android.hardware.Camera.CameraInfo; import android.view.View; -import android.widget.ImageView; /** * A view for switching the front/back camera. @@ -35,9 +34,11 @@ 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); } @@ -73,4 +74,14 @@ 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); + } + } } |