|
@@ -81,17 +81,22 @@ abstract class PagerViewer(val activity: ReaderActivity) : BaseViewer {
|
|
})
|
|
})
|
|
pager.tapListener = { event ->
|
|
pager.tapListener = { event ->
|
|
val tappingInverted = config.tappingInverted
|
|
val tappingInverted = config.tappingInverted
|
|
|
|
+
|
|
if (this is VerticalPagerViewer) {
|
|
if (this is VerticalPagerViewer) {
|
|
val positionY = event.y
|
|
val positionY = event.y
|
|
|
|
+ val topSideTap = positionY < pager.height * 0.33f && config.tappingEnabled
|
|
|
|
+ val bottomSideTap = positionY > pager.height * 0.66f && config.tappingEnabled
|
|
|
|
+
|
|
when {
|
|
when {
|
|
- positionY < pager.height * 0.33f && config.tappingEnabled -> moveLeft()
|
|
|
|
- positionY > pager.height * 0.66f && config.tappingEnabled -> moveRight()
|
|
|
|
|
|
+ topSideTap && !tappingInverted || bottomSideTap && tappingInverted -> moveLeft()
|
|
|
|
+ bottomSideTap && !tappingInverted || topSideTap && tappingInverted -> moveRight()
|
|
else -> activity.toggleMenu()
|
|
else -> activity.toggleMenu()
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
val positionX = event.x
|
|
val positionX = event.x
|
|
val leftSideTap = positionX < pager.width * 0.33f && config.tappingEnabled
|
|
val leftSideTap = positionX < pager.width * 0.33f && config.tappingEnabled
|
|
val rightSideTap = positionX > pager.width * 0.66f && config.tappingEnabled
|
|
val rightSideTap = positionX > pager.width * 0.66f && config.tappingEnabled
|
|
|
|
+
|
|
when {
|
|
when {
|
|
leftSideTap && !tappingInverted || rightSideTap && tappingInverted -> moveLeft()
|
|
leftSideTap && !tappingInverted || rightSideTap && tappingInverted -> moveLeft()
|
|
rightSideTap && !tappingInverted || leftSideTap && tappingInverted -> moveRight()
|
|
rightSideTap && !tappingInverted || leftSideTap && tappingInverted -> moveRight()
|