fix: remove long-press from swipe-controls

This commit is contained in:
EXAM454 2022-07-06 23:43:27 +05:30 committed by GitHub
parent fe8f7cb62f
commit 7c559bb13c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
@ -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?,