Skip to content
This repository has been archived by the owner on Oct 26, 2024. It is now read-only.

Commit

Permalink
fix: remove long-press from swipe-controls
Browse files Browse the repository at this point in the history
  • Loading branch information
EXAM454 authored Jul 6, 2022
1 parent fe8f7cb commit 7c559bb
Showing 1 changed file with 3 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,8 @@ class FensterController {
private val context: Context
) : GestureDetector.SimpleOnGestureListener() {

/**
* to enable swipe controls, users must first long- press. this flags monitors that long- press
*/
private var inSwipeSession = false

private var inSwipeSession = true

/**
* scroller for volume adjustment
Expand Down Expand Up @@ -176,24 +174,11 @@ class FensterController {
*/
fun onUp(e: MotionEvent) {
LogHelper.debug(this.javaClass, "onUp(${e.x}, ${e.y}, ${e.action})")
inSwipeSession = false
inSwipeSession = true
volumeScroller.reset()
brightnessScroller.reset()
}

override fun onLongPress(e: MotionEvent?) {
if (e == null) return
LogHelper.debug(this.javaClass, "onLongPress(${e.x}, ${e.y}, ${e.action})")

// enter swipe session with feedback
inSwipeSession = true
overlayController?.notifyEnterSwipeSession()

// make the GestureDetector believe there was a ACTION_UP event
// so it will handle further events
e.action = MotionEvent.ACTION_UP
gestureDetector?.onTouchEvent(e)
}

override fun onScroll(
eFrom: MotionEvent?,
Expand Down

0 comments on commit 7c559bb

Please sign in to comment.