summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2011-09-27 12:21:27 -0700
committerMichael Jurka <mikejurka@google.com>2011-09-28 11:22:47 -0700
commit1dee1c625e02138c3f230d951aed7feb6c924080 (patch)
tree36f3bedfbac482789f5024ce67f8360eb8da957b /src/com/android
parent9cf9756e53c883ea3829b106aead60045754b610 (diff)
downloadandroid_packages_apps_Gallery2-1dee1c625e02138c3f230d951aed7feb6c924080.tar.gz
android_packages_apps_Gallery2-1dee1c625e02138c3f230d951aed7feb6c924080.tar.bz2
android_packages_apps_Gallery2-1dee1c625e02138c3f230d951aed7feb6c924080.zip
Change gallery crop interface to be consistent with widget resizing
- Always show the resize controls when you're not touching the UI - Change the resize controls to the holo style Change-Id: Ia32235d6d82196a24b26fc78b9e9e1e3fb1f5250
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/gallery3d/photoeditor/actions/CropView.java24
-rw-r--r--src/com/android/gallery3d/ui/CropView.java42
2 files changed, 31 insertions, 35 deletions
diff --git a/src/com/android/gallery3d/photoeditor/actions/CropView.java b/src/com/android/gallery3d/photoeditor/actions/CropView.java
index 75d74fcff..4a2ac5f10 100644
--- a/src/com/android/gallery3d/photoeditor/actions/CropView.java
+++ b/src/com/android/gallery3d/photoeditor/actions/CropView.java
@@ -53,8 +53,7 @@ class CropView extends FullscreenToolView {
private static final float BORDER_WIDTH = 2.0f;
private final Paint borderPaint;
- private final Drawable heightIndicator;
- private final Drawable widthIndicator;
+ private final Drawable cropIndicator;
private final int indicatorSize;
private final RectF cropBounds = new RectF(0, 0, 1, 1);
@@ -67,8 +66,7 @@ class CropView extends FullscreenToolView {
super(context, attrs);
Resources resources = context.getResources();
- heightIndicator = resources.getDrawable(R.drawable.camera_crop_height_holo);
- widthIndicator = resources.getDrawable(R.drawable.camera_crop_width_holo);
+ cropIndicator = resources.getDrawable(R.drawable.camera_crop_holo);
indicatorSize = (int) resources.getDimension(R.dimen.crop_indicator_size);
borderPaint = new Paint();
@@ -233,18 +231,18 @@ class CropView extends FullscreenToolView {
drawShadow(canvas, cropped.left, cropped.bottom, cropped.right, displayBounds.bottom);
canvas.drawRect(cropped, borderPaint);
- boolean block = movingEdges == MOVE_BLOCK;
- if (((movingEdges & MOVE_TOP) != 0) || block) {
- drawIndicator(canvas, heightIndicator, cropped.centerX(), cropped.top);
+ boolean notMoving = movingEdges == 0;
+ if (((movingEdges & MOVE_TOP) != 0) || notMoving) {
+ drawIndicator(canvas, cropIndicator, cropped.centerX(), cropped.top);
}
- if (((movingEdges & MOVE_BOTTOM) != 0) || block) {
- drawIndicator(canvas, heightIndicator, cropped.centerX(), cropped.bottom);
+ if (((movingEdges & MOVE_BOTTOM) != 0) || notMoving) {
+ drawIndicator(canvas, cropIndicator, cropped.centerX(), cropped.bottom);
}
- if (((movingEdges & MOVE_LEFT) != 0) || block) {
- drawIndicator(canvas, widthIndicator, cropped.left, cropped.centerY());
+ if (((movingEdges & MOVE_LEFT) != 0) || notMoving) {
+ drawIndicator(canvas, cropIndicator, cropped.left, cropped.centerY());
}
- if (((movingEdges & MOVE_RIGHT) != 0) || block) {
- drawIndicator(canvas, widthIndicator, cropped.right, cropped.centerY());
+ if (((movingEdges & MOVE_RIGHT) != 0) || notMoving) {
+ drawIndicator(canvas, cropIndicator, cropped.right, cropped.centerY());
}
}
}
diff --git a/src/com/android/gallery3d/ui/CropView.java b/src/com/android/gallery3d/ui/CropView.java
index 9c59c9a84..71fdaab96 100644
--- a/src/com/android/gallery3d/ui/CropView.java
+++ b/src/com/android/gallery3d/ui/CropView.java
@@ -415,18 +415,15 @@ public class CropView extends GLView {
private RectF mTempRect = new RectF();
private PointF mTempPoint = new PointF();
- private ResourceTexture mArrowX;
- private ResourceTexture mArrowY;
+ private ResourceTexture mArrow;
private int mMovingEdges = 0;
private float mReferenceX;
private float mReferenceY;
public HighlightRectangle() {
- mArrowX = new ResourceTexture(mActivity.getAndroidContext(),
- R.drawable.camera_crop_width_holo);
- mArrowY = new ResourceTexture(mActivity.getAndroidContext(),
- R.drawable.camera_crop_height_holo);
+ mArrow = new ResourceTexture(mActivity.getAndroidContext(),
+ R.drawable.camera_crop_holo);
}
public void setInitRectangle() {
@@ -598,25 +595,26 @@ public class CropView extends GLView {
float centerY = (r.top + r.bottom) / 2;
float centerX = (r.left + r.right) / 2;
- if ((mMovingEdges & (MOVE_RIGHT | MOVE_BLOCK)) != 0) {
- mArrowX.draw(canvas,
- Math.round(r.right - mArrowX.getWidth() / 2),
- Math.round(centerY - mArrowX.getHeight() / 2));
+ boolean notMoving = mMovingEdges == 0;
+ if ((mMovingEdges & MOVE_RIGHT) != 0 || notMoving) {
+ mArrow.draw(canvas,
+ Math.round(r.right - mArrow.getWidth() / 2),
+ Math.round(centerY - mArrow.getHeight() / 2));
}
- if ((mMovingEdges & (MOVE_LEFT | MOVE_BLOCK)) != 0) {
- mArrowX.draw(canvas,
- Math.round(r.left - mArrowX.getWidth() / 2),
- Math.round(centerY - mArrowX.getHeight() / 2));
+ if ((mMovingEdges & MOVE_LEFT) != 0 || notMoving) {
+ mArrow.draw(canvas,
+ Math.round(r.left - mArrow.getWidth() / 2),
+ Math.round(centerY - mArrow.getHeight() / 2));
}
- if ((mMovingEdges & (MOVE_TOP | MOVE_BLOCK)) != 0) {
- mArrowY.draw(canvas,
- Math.round(centerX - mArrowY.getWidth() / 2),
- Math.round(r.top - mArrowY.getHeight() / 2));
+ if ((mMovingEdges & MOVE_TOP) != 0 || notMoving) {
+ mArrow.draw(canvas,
+ Math.round(centerX - mArrow.getWidth() / 2),
+ Math.round(r.top - mArrow.getHeight() / 2));
}
- if ((mMovingEdges & (MOVE_BOTTOM | MOVE_BLOCK)) != 0) {
- mArrowY.draw(canvas,
- Math.round(centerX - mArrowY.getWidth() / 2),
- Math.round(r.bottom - mArrowY.getHeight() / 2));
+ if ((mMovingEdges & MOVE_BOTTOM) != 0 || notMoving) {
+ mArrow.draw(canvas,
+ Math.round(centerX - mArrow.getWidth() / 2),
+ Math.round(r.bottom - mArrow.getHeight() / 2));
}
}