parent
97b4d1f13d
commit
90d3dd2242
@ -41,13 +41,13 @@ open class GestureDetectorWithLongTap(
|
|||||||
// This is the key difference with the built-in detector. We have to ignore the
|
// This is the key difference with the built-in detector. We have to ignore the
|
||||||
// event if the last up and current down are too close in time (double tap).
|
// event if the last up and current down are too close in time (double tap).
|
||||||
if (ev.downTime - lastUp > doubleTapTime) {
|
if (ev.downTime - lastUp > doubleTapTime) {
|
||||||
downX = ev.rawX
|
downX = ev.x
|
||||||
downY = ev.rawY
|
downY = ev.y
|
||||||
handler.postDelayed(longTapFn, longTapTime)
|
handler.postDelayed(longTapFn, longTapTime)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MotionEvent.ACTION_MOVE -> {
|
MotionEvent.ACTION_MOVE -> {
|
||||||
if (abs(ev.rawX - downX) > slop || abs(ev.rawY - downY) > slop) {
|
if (abs(ev.x - downX) > slop || abs(ev.y - downY) > slop) {
|
||||||
handler.removeCallbacks(longTapFn)
|
handler.removeCallbacks(longTapFn)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,7 @@ abstract class PagerViewer(val activity: ReaderActivity) : Viewer {
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
pager.tapListener = { event ->
|
pager.tapListener = { event ->
|
||||||
val pos = PointF(event.rawX / pager.width, event.rawY / pager.height)
|
val pos = PointF(event.x / pager.width, event.y / pager.height)
|
||||||
when (config.navigator.getAction(pos)) {
|
when (config.navigator.getAction(pos)) {
|
||||||
NavigationRegion.MENU -> activity.toggleMenu()
|
NavigationRegion.MENU -> activity.toggleMenu()
|
||||||
NavigationRegion.NEXT -> moveToNext()
|
NavigationRegion.NEXT -> moveToNext()
|
||||||
|
@ -111,7 +111,7 @@ class WebtoonViewer(val activity: ReaderActivity, val isContinuous: Boolean = tr
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
recycler.tapListener = { event ->
|
recycler.tapListener = { event ->
|
||||||
val pos = PointF(event.rawX / recycler.width, event.rawY / recycler.height)
|
val pos = PointF(event.x / recycler.width, event.y / recycler.height)
|
||||||
when (config.navigator.getAction(pos)) {
|
when (config.navigator.getAction(pos)) {
|
||||||
NavigationRegion.MENU -> activity.toggleMenu()
|
NavigationRegion.MENU -> activity.toggleMenu()
|
||||||
NavigationRegion.NEXT, NavigationRegion.RIGHT -> scrollDown()
|
NavigationRegion.NEXT, NavigationRegion.RIGHT -> scrollDown()
|
||||||
|
Loading…
Reference in New Issue
Block a user