diff options
| -rw-r--r-- | res/drawable-hdpi/camera_crop_height_holo.png | bin | 2390 -> 0 bytes | |||
| -rw-r--r-- | res/drawable-hdpi/camera_crop_holo.png | bin | 0 -> 653 bytes | |||
| -rw-r--r-- | res/drawable-hdpi/camera_crop_width_holo.png | bin | 2413 -> 0 bytes | |||
| -rw-r--r-- | res/drawable-mdpi/camera_crop_height_holo.png | bin | 2624 -> 0 bytes | |||
| -rw-r--r-- | res/drawable-mdpi/camera_crop_holo.png | bin | 0 -> 451 bytes | |||
| -rw-r--r-- | res/drawable-mdpi/camera_crop_width_holo.png | bin | 2675 -> 0 bytes | |||
| -rw-r--r-- | res/drawable-xhdpi/camera_crop_holo.png | bin | 0 -> 1071 bytes | |||
| -rw-r--r-- | src/com/android/gallery3d/photoeditor/actions/CropView.java | 24 | ||||
| -rw-r--r-- | src/com/android/gallery3d/ui/CropView.java | 42 |
9 files changed, 31 insertions, 35 deletions
diff --git a/res/drawable-hdpi/camera_crop_height_holo.png b/res/drawable-hdpi/camera_crop_height_holo.png Binary files differdeleted file mode 100644 index 19fdb8704..000000000 --- a/res/drawable-hdpi/camera_crop_height_holo.png +++ /dev/null diff --git a/res/drawable-hdpi/camera_crop_holo.png b/res/drawable-hdpi/camera_crop_holo.png Binary files differnew file mode 100644 index 000000000..477e67cfb --- /dev/null +++ b/res/drawable-hdpi/camera_crop_holo.png diff --git a/res/drawable-hdpi/camera_crop_width_holo.png b/res/drawable-hdpi/camera_crop_width_holo.png Binary files differdeleted file mode 100644 index 3c82e11d0..000000000 --- a/res/drawable-hdpi/camera_crop_width_holo.png +++ /dev/null diff --git a/res/drawable-mdpi/camera_crop_height_holo.png b/res/drawable-mdpi/camera_crop_height_holo.png Binary files differdeleted file mode 100644 index 45a6da93a..000000000 --- a/res/drawable-mdpi/camera_crop_height_holo.png +++ /dev/null diff --git a/res/drawable-mdpi/camera_crop_holo.png b/res/drawable-mdpi/camera_crop_holo.png Binary files differnew file mode 100644 index 000000000..ac56823bc --- /dev/null +++ b/res/drawable-mdpi/camera_crop_holo.png diff --git a/res/drawable-mdpi/camera_crop_width_holo.png b/res/drawable-mdpi/camera_crop_width_holo.png Binary files differdeleted file mode 100644 index e9f7a5c5c..000000000 --- a/res/drawable-mdpi/camera_crop_width_holo.png +++ /dev/null diff --git a/res/drawable-xhdpi/camera_crop_holo.png b/res/drawable-xhdpi/camera_crop_holo.png Binary files differnew file mode 100644 index 000000000..2c4eb5c4c --- /dev/null +++ b/res/drawable-xhdpi/camera_crop_holo.png 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)); } } |
