From 1dee1c625e02138c3f230d951aed7feb6c924080 Mon Sep 17 00:00:00 2001 From: Michael Jurka Date: Tue, 27 Sep 2011 12:21:27 -0700 Subject: 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 --- .../gallery3d/photoeditor/actions/CropView.java | 24 ++++++++++------------ 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'src/com/android/gallery3d/photoeditor') 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()); } } } -- cgit v1.2.3