summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/ui/CropView.java
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
commite3f4b8fd2435e0af778230df455c905e23ec583e (patch)
tree363def63e26639c58b1112294b2def1c023d39d3 /src/com/android/gallery3d/ui/CropView.java
parentb160bf641958039fb43c66b945e237ef78318c0e (diff)
downloadandroid_packages_apps_Snap-e3f4b8fd2435e0af778230df455c905e23ec583e.tar.gz
android_packages_apps_Snap-e3f4b8fd2435e0af778230df455c905e23ec583e.tar.bz2
android_packages_apps_Snap-e3f4b8fd2435e0af778230df455c905e23ec583e.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/gallery3d/ui/CropView.java')
-rw-r--r--src/com/android/gallery3d/ui/CropView.java42
1 files changed, 20 insertions, 22 deletions
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));
}
}