mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-07 11:17:25 +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
|
||||
|
||||
fun setNavigation(navigation: ViewerNavigation, showOnStart: Boolean) {
|
||||
if (!showOnStart && this.navigation == null) {
|
||||
this.navigation = navigation
|
||||
isVisible = false
|
||||
return
|
||||
}
|
||||
|
||||
fun setNavigation(navigation: ViewerNavigation, tappingEnabled: Boolean, showOnStart: Boolean) {
|
||||
val firstLaunch = this.navigation == null
|
||||
this.navigation = navigation
|
||||
invalidate()
|
||||
|
||||
if (isVisible) return
|
||||
if (isVisible || (!showOnStart && firstLaunch) || !tappingEnabled) {
|
||||
return
|
||||
}
|
||||
|
||||
viewPropertyAnimator = animate()
|
||||
.alpha(1f)
|
||||
|
@ -128,7 +128,7 @@ abstract class PagerViewer(val activity: ReaderActivity) : BaseViewer {
|
||||
|
||||
config.navigationModeChangedListener = {
|
||||
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 = {
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user