Add option to disable navigation layout (#6876)

This commit is contained in:
manatails 2022-04-09 05:32:25 +09:00 committed by GitHub
parent 346652e508
commit 175b77fe6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 25 additions and 0 deletions

View File

@ -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<Region> = listOf()
}

View File

@ -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.ReaderPageImageView
import eu.kanade.tachiyomi.ui.reader.viewer.ViewerConfig import eu.kanade.tachiyomi.ui.reader.viewer.ViewerConfig
import eu.kanade.tachiyomi.ui.reader.viewer.ViewerNavigation 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.EdgeNavigation
import eu.kanade.tachiyomi.ui.reader.viewer.navigation.KindlishNavigation import eu.kanade.tachiyomi.ui.reader.viewer.navigation.KindlishNavigation
import eu.kanade.tachiyomi.ui.reader.viewer.navigation.LNavigation import eu.kanade.tachiyomi.ui.reader.viewer.navigation.LNavigation
@ -131,6 +132,7 @@ class PagerConfig(
2 -> KindlishNavigation() 2 -> KindlishNavigation()
3 -> EdgeNavigation() 3 -> EdgeNavigation()
4 -> RightAndLeftNavigation() 4 -> RightAndLeftNavigation()
5 -> DisabledNavigation()
else -> defaultNavigation() else -> defaultNavigation()
} }
navigationModeChangedListener?.invoke() navigationModeChangedListener?.invoke()

View File

@ -3,6 +3,7 @@ package eu.kanade.tachiyomi.ui.reader.viewer.webtoon
import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.data.preference.PreferencesHelper
import eu.kanade.tachiyomi.ui.reader.viewer.ViewerConfig import eu.kanade.tachiyomi.ui.reader.viewer.ViewerConfig
import eu.kanade.tachiyomi.ui.reader.viewer.ViewerNavigation 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.EdgeNavigation
import eu.kanade.tachiyomi.ui.reader.viewer.navigation.KindlishNavigation import eu.kanade.tachiyomi.ui.reader.viewer.navigation.KindlishNavigation
import eu.kanade.tachiyomi.ui.reader.viewer.navigation.LNavigation import eu.kanade.tachiyomi.ui.reader.viewer.navigation.LNavigation
@ -79,6 +80,7 @@ class WebtoonConfig(
2 -> KindlishNavigation() 2 -> KindlishNavigation()
3 -> EdgeNavigation() 3 -> EdgeNavigation()
4 -> RightAndLeftNavigation() 4 -> RightAndLeftNavigation()
5 -> DisabledNavigation()
else -> defaultNavigation() else -> defaultNavigation()
} }
navigationModeChangedListener?.invoke() navigationModeChangedListener?.invoke()

View File

@ -85,6 +85,7 @@
<item>@string/kindlish_nav</item> <item>@string/kindlish_nav</item>
<item>@string/edge_nav</item> <item>@string/edge_nav</item>
<item>@string/right_and_left_nav</item> <item>@string/right_and_left_nav</item>
<item>@string/disabled_nav</item>
</string-array> </string-array>
<string-array name="webtoon_nav"> <string-array name="webtoon_nav">
@ -93,5 +94,6 @@
<item>@string/kindlish_nav</item> <item>@string/kindlish_nav</item>
<item>@string/edge_nav</item> <item>@string/edge_nav</item>
<item>@string/right_and_left_nav</item> <item>@string/right_and_left_nav</item>
<item>@string/disabled_nav</item>
</string-array> </string-array>
</resources> </resources>

View File

@ -335,6 +335,7 @@
<string name="kindlish_nav">Kindle-ish</string> <string name="kindlish_nav">Kindle-ish</string>
<string name="edge_nav">Edge</string> <string name="edge_nav">Edge</string>
<string name="right_and_left_nav">Right and Left</string> <string name="right_and_left_nav">Right and Left</string>
<string name="disabled_nav">Disabled</string>
<string name="nav_zone_prev">Prev</string> <string name="nav_zone_prev">Prev</string>
<string name="nav_zone_next">Next</string> <string name="nav_zone_next">Next</string>
<string name="nav_zone_left">Left</string> <string name="nav_zone_left">Left</string>