From 8de004d281905b5fb4f2bdaa24fd5a4ef274af2a Mon Sep 17 00:00:00 2001 From: raslmenea Date: Sat, 18 Apr 2020 01:35:04 +0300 Subject: [PATCH] toggle reader menu if transition by tapping are disabled (#2887) Co-authored-by: raslmenea.rm@gmail.com --- .../eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerViewer.kt | 4 ++-- .../tachiyomi/ui/reader/viewer/webtoon/WebtoonViewer.kt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerViewer.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerViewer.kt index bcca48887..302853767 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerViewer.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerViewer.kt @@ -82,8 +82,8 @@ abstract class PagerViewer(val activity: ReaderActivity) : BaseViewer { pager.tapListener = { event -> val positionX = event.x when { - positionX < pager.width * 0.33f -> if (config.tappingEnabled) moveLeft() - positionX > pager.width * 0.66f -> if (config.tappingEnabled) moveRight() + positionX < pager.width * 0.33f -> if (config.tappingEnabled) moveLeft() else activity.toggleMenu() + positionX > pager.width * 0.66f -> if (config.tappingEnabled) moveRight() else activity.toggleMenu() else -> activity.toggleMenu() } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonViewer.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonViewer.kt index 3e154a7b1..12052a91d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonViewer.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonViewer.kt @@ -95,8 +95,8 @@ class WebtoonViewer(val activity: ReaderActivity, val isContinuous: Boolean = tr recycler.tapListener = { event -> val positionX = event.rawX when { - positionX < recycler.width * 0.33 -> if (config.tappingEnabled) scrollUp() - positionX > recycler.width * 0.66 -> if (config.tappingEnabled) scrollDown() + positionX < recycler.width * 0.33 -> if (config.tappingEnabled) scrollUp() else activity.toggleMenu() + positionX > recycler.width * 0.66 -> if (config.tappingEnabled) scrollDown() else activity.toggleMenu() else -> activity.toggleMenu() } }