mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-22 14:31:52 +01:00
Don't show navigation overlay if tap navigation is disabled (#5534)
* Don't show navigation overlay if tap navigation is disabled * Apply feedback
This commit is contained in:
parent
ae97bb0445
commit
b7c2890250
@ -19,17 +19,14 @@ class ReaderNavigationOverlayView(context: Context, attributeSet: AttributeSet)
|
|||||||
|
|
||||||
private var navigation: ViewerNavigation? = null
|
private var navigation: ViewerNavigation? = null
|
||||||
|
|
||||||
fun setNavigation(navigation: ViewerNavigation, showOnStart: Boolean) {
|
fun setNavigation(navigation: ViewerNavigation, tappingEnabled: Boolean, showOnStart: Boolean) {
|
||||||
if (!showOnStart && this.navigation == null) {
|
val firstLaunch = this.navigation == null
|
||||||
this.navigation = navigation
|
|
||||||
isVisible = false
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
this.navigation = navigation
|
this.navigation = navigation
|
||||||
invalidate()
|
invalidate()
|
||||||
|
|
||||||
if (isVisible) return
|
if (isVisible || (!showOnStart && firstLaunch) || !tappingEnabled) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
viewPropertyAnimator = animate()
|
viewPropertyAnimator = animate()
|
||||||
.alpha(1f)
|
.alpha(1f)
|
||||||
|
@ -128,7 +128,7 @@ abstract class PagerViewer(val activity: ReaderActivity) : BaseViewer {
|
|||||||
|
|
||||||
config.navigationModeChangedListener = {
|
config.navigationModeChangedListener = {
|
||||||
val showOnStart = config.navigationOverlayOnStart || config.forceNavigationOverlay
|
val showOnStart = config.navigationOverlayOnStart || config.forceNavigationOverlay
|
||||||
activity.binding.navigationOverlay.setNavigation(config.navigator, showOnStart)
|
activity.binding.navigationOverlay.setNavigation(config.navigator, config.tappingEnabled, showOnStart)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ class WebtoonViewer(val activity: ReaderActivity, val isContinuous: Boolean = tr
|
|||||||
|
|
||||||
config.navigationModeChangedListener = {
|
config.navigationModeChangedListener = {
|
||||||
val showOnStart = config.navigationOverlayOnStart || config.forceNavigationOverlay
|
val showOnStart = config.navigationOverlayOnStart || config.forceNavigationOverlay
|
||||||
activity.binding.navigationOverlay.setNavigation(config.navigator, showOnStart)
|
activity.binding.navigationOverlay.setNavigation(config.navigator, config.tappingEnabled, showOnStart)
|
||||||
}
|
}
|
||||||
|
|
||||||
frame.layoutParams = ViewGroup.LayoutParams(MATCH_PARENT, MATCH_PARENT)
|
frame.layoutParams = ViewGroup.LayoutParams(MATCH_PARENT, MATCH_PARENT)
|
||||||
|
Loading…
Reference in New Issue
Block a user