From 175b77fe6fda138a1ab153a589a6539b9c1933d7 Mon Sep 17 00:00:00 2001 From: manatails Date: Sat, 9 Apr 2022 05:32:25 +0900 Subject: [PATCH] Add option to disable navigation layout (#6876) --- .../viewer/navigation/DisabledNavigation.kt | 18 ++++++++++++++++++ .../ui/reader/viewer/pager/PagerConfig.kt | 2 ++ .../ui/reader/viewer/webtoon/WebtoonConfig.kt | 2 ++ app/src/main/res/values/arrays.xml | 2 ++ app/src/main/res/values/strings.xml | 1 + 5 files changed, 25 insertions(+) create mode 100644 app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/navigation/DisabledNavigation.kt diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/navigation/DisabledNavigation.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/navigation/DisabledNavigation.kt new file mode 100644 index 0000000000..7f8d73be1c --- /dev/null +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/navigation/DisabledNavigation.kt @@ -0,0 +1,18 @@ +package eu.kanade.tachiyomi.ui.reader.viewer.navigation + +import eu.kanade.tachiyomi.ui.reader.viewer.ViewerNavigation + +/** + * Visualization of default state without any inversion + * +---+---+---+ + * | M | M | M | P: Previous + * +---+---+---+ + * | M | M | M | M: Menu + * +---+---+---+ + * | M | M | M | N: Next + * +---+---+---+ +*/ +class DisabledNavigation : ViewerNavigation() { + + override var regions: List = listOf() +} diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerConfig.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerConfig.kt index ad79adf310..bf50dc2026 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerConfig.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerConfig.kt @@ -4,6 +4,7 @@ import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.ui.reader.viewer.ReaderPageImageView import eu.kanade.tachiyomi.ui.reader.viewer.ViewerConfig import eu.kanade.tachiyomi.ui.reader.viewer.ViewerNavigation +import eu.kanade.tachiyomi.ui.reader.viewer.navigation.DisabledNavigation import eu.kanade.tachiyomi.ui.reader.viewer.navigation.EdgeNavigation import eu.kanade.tachiyomi.ui.reader.viewer.navigation.KindlishNavigation import eu.kanade.tachiyomi.ui.reader.viewer.navigation.LNavigation @@ -131,6 +132,7 @@ class PagerConfig( 2 -> KindlishNavigation() 3 -> EdgeNavigation() 4 -> RightAndLeftNavigation() + 5 -> DisabledNavigation() else -> defaultNavigation() } navigationModeChangedListener?.invoke() diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonConfig.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonConfig.kt index f14a02e5d7..dceb8e8f4d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonConfig.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonConfig.kt @@ -3,6 +3,7 @@ package eu.kanade.tachiyomi.ui.reader.viewer.webtoon import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.ui.reader.viewer.ViewerConfig import eu.kanade.tachiyomi.ui.reader.viewer.ViewerNavigation +import eu.kanade.tachiyomi.ui.reader.viewer.navigation.DisabledNavigation import eu.kanade.tachiyomi.ui.reader.viewer.navigation.EdgeNavigation import eu.kanade.tachiyomi.ui.reader.viewer.navigation.KindlishNavigation import eu.kanade.tachiyomi.ui.reader.viewer.navigation.LNavigation @@ -79,6 +80,7 @@ class WebtoonConfig( 2 -> KindlishNavigation() 3 -> EdgeNavigation() 4 -> RightAndLeftNavigation() + 5 -> DisabledNavigation() else -> defaultNavigation() } navigationModeChangedListener?.invoke() diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index 6f2b711a2d..0315287473 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -85,6 +85,7 @@ @string/kindlish_nav @string/edge_nav @string/right_and_left_nav + @string/disabled_nav @@ -93,5 +94,6 @@ @string/kindlish_nav @string/edge_nav @string/right_and_left_nav + @string/disabled_nav diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b6ff13c445..26860446b3 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -335,6 +335,7 @@ Kindle-ish Edge Right and Left + Disabled Prev Next Left