mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-20 05:59:17 +01:00
Some fixes to temporarily showing/hiding the reading menu in some cases
like showing system bars or opening notification drawer etc.
This commit is contained in:
parent
34fc0a662c
commit
d0b4b33466
@ -303,20 +303,6 @@ class ReaderActivity :
|
|||||||
super.onSaveInstanceState(outState)
|
super.onSaveInstanceState(outState)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when the window focus changes. It sets the menu visibility to the last known state
|
|
||||||
* to apply again System UI (for immersive mode).
|
|
||||||
*/
|
|
||||||
override fun onWindowFocusChanged(hasFocus: Boolean) {
|
|
||||||
super.onWindowFocusChanged(hasFocus)
|
|
||||||
if (hasFocus) {
|
|
||||||
when (menuStickyVisible) {
|
|
||||||
true -> setMenuVisibility(false)
|
|
||||||
false -> setMenuVisibility(menuVisible, animate = false)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the options menu of the binding.toolbar is being created. It adds our custom menu.
|
* Called when the options menu of the binding.toolbar is being created. It adds our custom menu.
|
||||||
*/
|
*/
|
||||||
@ -1290,7 +1276,7 @@ class ReaderActivity :
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onVisibilityChange(visible: Boolean) {
|
override fun onVisibilityChange(visible: Boolean) {
|
||||||
if (visible && !menuStickyVisible && !menuVisible) {
|
if (visible && !menuStickyVisible && !menuVisible && !binding.readerMenu.isVisible) {
|
||||||
menuStickyVisible = visible
|
menuStickyVisible = visible
|
||||||
if (visible) {
|
if (visible) {
|
||||||
coroutine = launchUI {
|
coroutine = launchUI {
|
||||||
@ -1313,9 +1299,9 @@ class ReaderActivity :
|
|||||||
)
|
)
|
||||||
binding.appBar.startAnimation(toolbarAnimation)
|
binding.appBar.startAnimation(toolbarAnimation)
|
||||||
}
|
}
|
||||||
} else {
|
} else if (!visible && (menuStickyVisible || menuVisible)) {
|
||||||
if (menuStickyVisible && !menuVisible) {
|
if (menuStickyVisible && !menuVisible) {
|
||||||
setMenuVisibility(false, animate = false)
|
setMenuVisibility(false)
|
||||||
}
|
}
|
||||||
coroutine?.cancel()
|
coroutine?.cancel()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user