summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/ui
diff options
context:
space:
mode:
authorChung-yih Wang <cywang@google.com>2011-08-05 01:14:35 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-08-05 01:14:35 -0700
commit0980ef20897b2b83ee1ddce300044c121192f599 (patch)
treecd0396f2a3d76b94db114627742b66146bf31410 /src/com/android/camera/ui
parent141cf9386c6053e655ef054f499230cfafba3ff6 (diff)
parentb5c569214281e11dc7e8ffc313fbb27e5ff6e5c5 (diff)
downloadLegacyCamera-0980ef20897b2b83ee1ddce300044c121192f599.zip
LegacyCamera-0980ef20897b2b83ee1ddce300044c121192f599.tar.gz
LegacyCamera-0980ef20897b2b83ee1ddce300044c121192f599.tar.bz2
Merge "Add the CameraPicker for PhoneUI."
Diffstat (limited to 'src/com/android/camera/ui')
-rw-r--r--src/com/android/camera/ui/AbstractIndicatorButton.java1
-rw-r--r--src/com/android/camera/ui/IndicatorControl.java1
-rw-r--r--src/com/android/camera/ui/RotateImageView.java7
3 files changed, 9 insertions, 0 deletions
diff --git a/src/com/android/camera/ui/AbstractIndicatorButton.java b/src/com/android/camera/ui/AbstractIndicatorButton.java
index 07cdf0d..8893aa8 100644
--- a/src/com/android/camera/ui/AbstractIndicatorButton.java
+++ b/src/com/android/camera/ui/AbstractIndicatorButton.java
@@ -40,6 +40,7 @@ public abstract class AbstractIndicatorButton extends RotateImageView {
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);
}
// Whether scene mode affects this indicator and it cannot be changed.
diff --git a/src/com/android/camera/ui/IndicatorControl.java b/src/com/android/camera/ui/IndicatorControl.java
index 5a2a72c..d90768f 100644
--- a/src/com/android/camera/ui/IndicatorControl.java
+++ b/src/com/android/camera/ui/IndicatorControl.java
@@ -24,6 +24,7 @@ import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
+import android.widget.ImageView;
import java.util.ArrayList;
diff --git a/src/com/android/camera/ui/RotateImageView.java b/src/com/android/camera/ui/RotateImageView.java
index 4085bb2..80752a2 100644
--- a/src/com/android/camera/ui/RotateImageView.java
+++ b/src/com/android/camera/ui/RotateImageView.java
@@ -121,6 +121,13 @@ public class RotateImageView extends ImageView {
int height = getHeight() - top - bottom;
int saveCount = canvas.getSaveCount();
+
+ // Scale down the image first if required.
+ if ((getScaleType() == ImageView.ScaleType.FIT_CENTER) &&
+ ((width < w) || (height < h))) {
+ float ratio = Math.min((float) width / w, (float) height / h);
+ canvas.scale(ratio, ratio, width / 2.0f, height / 2.0f);
+ }
canvas.translate(left + width / 2, top + height / 2);
canvas.rotate(-mCurrentDegree);
canvas.translate(-w / 2, -h / 2);