summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWu-cheng Li <wuchengli@google.com>2012-08-13 17:31:22 +0800
committerWu-cheng Li <wuchengli@google.com>2012-08-13 17:40:42 +0800
commit37ba3d7b5953decbb7cc21f74cd61ceed12b199a (patch)
tree347ef79a94467c33155707c5eb9552e38743a719 /src
parent42a68a6f524bbd206b68eda650cc45d7e2a509af (diff)
downloadandroid_packages_apps_Gallery2-37ba3d7b5953decbb7cc21f74cd61ceed12b199a.tar.gz
android_packages_apps_Gallery2-37ba3d7b5953decbb7cc21f74cd61ceed12b199a.tar.bz2
android_packages_apps_Gallery2-37ba3d7b5953decbb7cc21f74cd61ceed12b199a.zip
Make a copy of MotionEvent in MotionEventHelper.transform.
RotateLayout transforms the event in dispatchTouchEvent. If the event is not handled, the parent of RotateLayout may send the transformed event to other views and the coordinates will be wrong. Make a copy of MotionEvent in transform. This also makes the behavior consistent in different API levels. bug:6974916 Change-Id: Id835767cc9be3f244e5abe2b855e5188045adedc
Diffstat (limited to 'src')
-rw-r--r--src/com/android/gallery3d/util/MotionEventHelper.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/com/android/gallery3d/util/MotionEventHelper.java b/src/com/android/gallery3d/util/MotionEventHelper.java
index 1c9d06244..715f7fa69 100644
--- a/src/com/android/gallery3d/util/MotionEventHelper.java
+++ b/src/com/android/gallery3d/util/MotionEventHelper.java
@@ -38,8 +38,9 @@ public final class MotionEventHelper {
@TargetApi(ApiHelper.VERSION_CODES.HONEYCOMB)
private static MotionEvent transformEventNew(MotionEvent e, Matrix m) {
- e.transform(m);
- return e;
+ MotionEvent newEvent = MotionEvent.obtain(e);
+ newEvent.transform(m);
+ return newEvent;
}
// This is copied from Input.cpp in the android framework.