Gallery: rotate icon is counter-clockwise, so do it!
Previously, rotation was clockwise, conflicting with the icon.
Change-Id: Ibd4841d7d959b5e597a87f2fe0de8c9d69878440
diff --git a/src/com/android/gallery3d/filtershow/FilterShowActivity.java b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
index 143a546..a9a1715 100755
--- a/src/com/android/gallery3d/filtershow/FilterShowActivity.java
+++ b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
@@ -1438,7 +1438,7 @@
if (representation instanceof FilterRotateRepresentation) {
FilterRotateRepresentation r = (FilterRotateRepresentation) representation;
- r.rotateCW();
+ r.rotateCCW();
}
if (representation instanceof FilterMirrorRepresentation) {
FilterMirrorRepresentation r = (FilterMirrorRepresentation) representation;
diff --git a/src/com/android/gallery3d/filtershow/filters/FilterRotateRepresentation.java b/src/com/android/gallery3d/filtershow/filters/FilterRotateRepresentation.java
index d858d08..9c321f0 100644
--- a/src/com/android/gallery3d/filtershow/filters/FilterRotateRepresentation.java
+++ b/src/com/android/gallery3d/filtershow/filters/FilterRotateRepresentation.java
@@ -103,6 +103,23 @@
}
}
+ public void rotateCCW() {
+ switch(mRotation) {
+ case ZERO:
+ mRotation = Rotation.TWO_SEVENTY;
+ break;
+ case NINETY:
+ mRotation = Rotation.ZERO;
+ break;
+ case ONE_EIGHTY:
+ mRotation = Rotation.NINETY;
+ break;
+ case TWO_SEVENTY:
+ mRotation = Rotation.ONE_EIGHTY;
+ break;
+ }
+ }
+
public void set(FilterRotateRepresentation r) {
mRotation = r.mRotation;
}
diff --git a/src/com/android/gallery3d/filtershow/imageshow/ImageRotate.java b/src/com/android/gallery3d/filtershow/imageshow/ImageRotate.java
index a620847..fce31e5 100644
--- a/src/com/android/gallery3d/filtershow/imageshow/ImageRotate.java
+++ b/src/com/android/gallery3d/filtershow/imageshow/ImageRotate.java
@@ -45,7 +45,7 @@
}
public void rotate() {
- mLocalRep.rotateCW();
+ mLocalRep.rotateCCW();
invalidate();
}
diff --git a/src/com/android/gallery3d/filtershow/imageshow/MasterImage.java b/src/com/android/gallery3d/filtershow/imageshow/MasterImage.java
index 58048bf..f71b264 100644
--- a/src/com/android/gallery3d/filtershow/imageshow/MasterImage.java
+++ b/src/com/android/gallery3d/filtershow/imageshow/MasterImage.java
@@ -565,7 +565,7 @@
if (mAnimator != null) {
mAnimator.cancel();
if (mCurrentLookAnimation == ROTATE_ANIMATION) {
- mCurrentAnimRotationStartValue += 90;
+ mCurrentAnimRotationStartValue -= 90;
}
} else {
resetAnimBitmap();
@@ -578,7 +578,7 @@
}
if (newRepresentation instanceof FilterRotateRepresentation) {
mCurrentLookAnimation = ROTATE_ANIMATION;
- mAnimator = ValueAnimator.ofFloat(0, 90);
+ mAnimator = ValueAnimator.ofFloat(0, -90);
mAnimator.setDuration(500);
}
if (newRepresentation instanceof FilterMirrorRepresentation) {