This commit is contained in:
Jays2Kings 2021-04-23 23:19:55 -04:00
parent 6906fff121
commit ec87df7056
2 changed files with 8 additions and 2 deletions

View File

@ -42,6 +42,7 @@ import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.database.models.Chapter
import eu.kanade.tachiyomi.data.database.models.Manga
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
import eu.kanade.tachiyomi.data.preference.asImmediateFlow
import eu.kanade.tachiyomi.data.preference.toggle
import eu.kanade.tachiyomi.databinding.ReaderActivityBinding
import eu.kanade.tachiyomi.source.model.Page
@ -928,7 +929,7 @@ class ReaderActivity :
lastShiftDoubleState?.let { newViewer.config.shiftDoublePage = it }
}
binding.navigationOverlay.isLTR = !(viewer is L2RPagerViewer)
binding.navigationOverlay.isLTR = viewer !is L2RPagerViewer
binding.viewerContainer.setBackgroundColor(
if (viewer is WebtoonViewer) {
Color.BLACK
@ -1474,6 +1475,10 @@ class ReaderActivity :
updateBottomShortcuts()
}
.launchIn(scope)
preferences.readWithTapping().asImmediateFlow(scope) {
binding?.navigationOverlay.tappingEnabled = it
}
}
/**

View File

@ -20,6 +20,7 @@ class ReaderNavigationOverlayView(context: Context, attributeSet: AttributeSet)
private var navigation: ViewerNavigation? = null
var isLTR = true
var tappingEnabled = true
fun setNavigation(navigation: ViewerNavigation, showOnStart: Boolean) {
if (!showOnStart && (this.navigation == null || this.navigation === navigation)) {
@ -37,7 +38,7 @@ class ReaderNavigationOverlayView(context: Context, attributeSet: AttributeSet)
fun showNavigationAgain() {
invalidate()
if (isVisible) return
if (isVisible || !tappingEnabled) return
viewPropertyAnimator = animate()
.alpha(1f)