Skip to content

Commit

Permalink
Revert "feat: speed up single tap gestures"
Browse files Browse the repository at this point in the history
This reverts commit 02a022a.

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
  • Loading branch information
david-allison authored and mikehardy committed Dec 18, 2023
1 parent 69910ab commit 2fbeb7c
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions AnkiDroid/src/main/java/com/ichi2/anki/AbstractFlashcardViewer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2fbeb7c

Please sign in to comment.