diff options
author | Jorge Ruesga <jorge@ruesga.com> | 2013-08-14 11:16:39 +0200 |
---|---|---|
committer | Jorge Ruesga <jorge@ruesga.com> | 2013-08-14 11:16:39 +0200 |
commit | 39e18f77c7821ff476ad443c07c9e381473131f4 (patch) | |
tree | 9e1fbf7b032f303ebcf13eca5bfa1e6126c94124 /src/org | |
parent | e27453b6acc75d214ebc1b2c4317f109e8ac26a2 (diff) | |
download | android_packages_wallpapers_PhotoPhase-39e18f77c7821ff476ad443c07c9e381473131f4.tar.gz android_packages_wallpapers_PhotoPhase-39e18f77c7821ff476ad443c07c9e381473131f4.tar.bz2 android_packages_wallpapers_PhotoPhase-39e18f77c7821ff476ad443c07c9e381473131f4.zip |
Avoid to handle multiple touchs
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/cyanogenmod/wallpapers/photophase/PhotoPhaseRenderer.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/org/cyanogenmod/wallpapers/photophase/PhotoPhaseRenderer.java b/src/org/cyanogenmod/wallpapers/photophase/PhotoPhaseRenderer.java index 7c622fb..6432767 100644 --- a/src/org/cyanogenmod/wallpapers/photophase/PhotoPhaseRenderer.java +++ b/src/org/cyanogenmod/wallpapers/photophase/PhotoPhaseRenderer.java @@ -72,6 +72,9 @@ public class PhotoPhaseRenderer implements GLSurfaceView.Renderer { /*package*/ long mLastRunningTransition; + private long mLastTouchTime; + private static final long TOUCH_BARRIER_TIME = 1000L; + /*package*/ int mWidth = -1; /*package*/ int mHeight = -1; /*package*/ int mMeasuredHeight = -1; @@ -268,6 +271,14 @@ public class PhotoPhaseRenderer implements GLSurfaceView.Renderer { if (touchAction.compareTo(TouchAction.NONE) == 0) { //Ignore } else { + // Avoid to handle multiple touchs + long touchTime = System.currentTimeMillis(); + long diff = touchTime - mLastTouchTime; + mLastTouchTime = touchTime; + if (diff < TOUCH_BARRIER_TIME) { + return; + } + // Retrieve the photo frame for its coordinates final PhotoFrame frame = mWorld.getFrameFromCoordinates(new PointF(x, y)); if (frame == null) { |