From 2fbeb7c1d2eb22f00b2d3b915c5a77b2f737511f Mon Sep 17 00:00:00 2001 From: David Allison <62114487+david-allison@users.noreply.github.com> Date: Mon, 18 Dec 2023 00:51:19 +0000 Subject: [PATCH] Revert "feat: speed up single tap gestures" This reverts commit 02a022a107831dc5414acbd23f5568fb5a4f5f67. This broke clicking links in the Viewer I've spent a bit of time and it will be difficult to get it working correctly, so reverting Fixes 15015 --- .../java/com/ichi2/anki/AbstractFlashcardViewer.kt | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/AbstractFlashcardViewer.kt b/AnkiDroid/src/main/java/com/ichi2/anki/AbstractFlashcardViewer.kt index 1b51484da653..a147c755eb0d 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/AbstractFlashcardViewer.kt +++ b/AnkiDroid/src/main/java/com/ichi2/anki/AbstractFlashcardViewer.kt @@ -2089,9 +2089,6 @@ abstract class AbstractFlashcardViewer : } internal open inner class MyGestureDetector : SimpleOnGestureListener() { - /** Whether we need to wait for confirmation that a tap is not a double tap */ - private val waitForDoubleTap get() = mGestureProcessor.isBound(Gesture.DOUBLE_TAP) - override fun onFling( e1: MotionEvent?, e2: MotionEvent, @@ -2144,17 +2141,11 @@ abstract class AbstractFlashcardViewer : return true } - override fun onDown(e: MotionEvent): Boolean { - if (waitForDoubleTap) return super.onDown(e) - return handleTap(e) + override fun onSingleTapUp(e: MotionEvent): Boolean { + return false } override fun onSingleTapConfirmed(e: MotionEvent): Boolean { - if (!waitForDoubleTap) return super.onSingleTapConfirmed(e) - return handleTap(e) - } - - private fun handleTap(e: MotionEvent): Boolean { // Go back to immersive mode if the user had temporarily exited it (and ignore the tap gesture) if (onSingleTap()) { return true