summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/ui/GestureRecognizer.java
diff options
context:
space:
mode:
authorChih-Chung Chang <chihchung@google.com>2012-03-21 19:01:30 +0800
committerChih-Chung Chang <chihchung@google.com>2012-03-26 19:25:49 +0800
commit534b12fd804610dd67b8109bc08ba76f31afb33e (patch)
treea6ead1650e3530c0cbf344c48cb8c2aec7ed09a0 /src/com/android/gallery3d/ui/GestureRecognizer.java
parentbf71930c60d207fa92790e0f2f57b99c78d6b9a2 (diff)
downloadandroid_packages_apps_Gallery2-534b12fd804610dd67b8109bc08ba76f31afb33e.tar.gz
android_packages_apps_Gallery2-534b12fd804610dd67b8109bc08ba76f31afb33e.tar.bz2
android_packages_apps_Gallery2-534b12fd804610dd67b8109bc08ba76f31afb33e.zip
Patch 2 for master.
Change-Id: I8b7c9fd326c4f247a1f2129b1d64388a223d79e0
Diffstat (limited to 'src/com/android/gallery3d/ui/GestureRecognizer.java')
-rw-r--r--src/com/android/gallery3d/ui/GestureRecognizer.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/ui/GestureRecognizer.java b/src/com/android/gallery3d/ui/GestureRecognizer.java
index 492f993d7..4a17d4364 100644
--- a/src/com/android/gallery3d/ui/GestureRecognizer.java
+++ b/src/com/android/gallery3d/ui/GestureRecognizer.java
@@ -17,6 +17,7 @@
package com.android.gallery3d.ui;
import android.content.Context;
+import android.os.SystemClock;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.ScaleGestureDetector;
@@ -62,6 +63,14 @@ public class GestureRecognizer {
return mDownUpDetector.isDown();
}
+ public void cancelScale() {
+ long now = SystemClock.uptimeMillis();
+ MotionEvent cancelEvent = MotionEvent.obtain(
+ now, now, MotionEvent.ACTION_CANCEL, 0, 0, 0);
+ mScaleDetector.onTouchEvent(cancelEvent);
+ cancelEvent.recycle();
+ }
+
private class MyGestureListener
extends GestureDetector.SimpleOnGestureListener {
@Override