Fix nav overlay always showing on start (fixes #4736)

This commit is contained in:
arkon 2021-03-29 09:13:33 -04:00
parent bdbdf211e2
commit 988ec6a224
2 changed files with 16 additions and 14 deletions

View File

@ -8,6 +8,9 @@ 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
import eu.kanade.tachiyomi.ui.reader.viewer.navigation.RightAndLeftNavigation import eu.kanade.tachiyomi.ui.reader.viewer.navigation.RightAndLeftNavigation
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.drop
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get import uy.kohesive.injekt.api.get
@ -45,13 +48,11 @@ class PagerConfig(
.register({ navigationMode = it }, { updateNavigation(navigationMode) }) .register({ navigationMode = it }, { updateNavigation(navigationMode) })
preferences.pagerNavInverted() preferences.pagerNavInverted()
.register( .register({ tappingInverted = it }, { navigator.invertMode = it })
{ tappingInverted = it }, preferences.pagerNavInverted().asFlow()
{ .drop(1)
navigator.invertMode = it .onEach { navigationModeChangedListener?.invoke() }
navigationModeChangedListener?.invoke() .launchIn(scope)
}
)
preferences.dualPageSplitPaged() preferences.dualPageSplitPaged()
.register( .register(

View File

@ -8,6 +8,9 @@ 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
import eu.kanade.tachiyomi.ui.reader.viewer.navigation.RightAndLeftNavigation import eu.kanade.tachiyomi.ui.reader.viewer.navigation.RightAndLeftNavigation
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.drop
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get import uy.kohesive.injekt.api.get
@ -36,13 +39,11 @@ class WebtoonConfig(
.register({ navigationMode = it }, { updateNavigation(it) }) .register({ navigationMode = it }, { updateNavigation(it) })
preferences.webtoonNavInverted() preferences.webtoonNavInverted()
.register( .register({ tappingInverted = it }, { navigator.invertMode = it })
{ tappingInverted = it }, preferences.webtoonNavInverted().asFlow()
{ .drop(1)
navigator.invertMode = it .onEach { navigationModeChangedListener?.invoke() }
navigationModeChangedListener?.invoke() .launchIn(scope)
}
)
preferences.dualPageSplitWebtoon() preferences.dualPageSplitWebtoon()
.register({ dualPageSplit = it }, { imagePropertyChangedListener?.invoke() }) .register({ dualPageSplit = it }, { imagePropertyChangedListener?.invoke() })