diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt index ffad71a392..c352856235 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt @@ -202,7 +202,7 @@ class ReaderActivity : BaseRxActivity(), if (menuStickyVisible) setMenuVisibility(false) else - setMenuVisibility(menuVisible, animate = false) + setMenuVisibility(menuVisible, animate = false) } } @@ -303,7 +303,7 @@ class ReaderActivity : BaseRxActivity(), */ private fun setMenuVisibility(visible: Boolean, animate: Boolean = true) { menuVisible = visible - coroutine?.cancel() + if (visible) coroutine?.cancel() if (visible) { systemUi?.show() reader_menu.visibility = View.VISIBLE @@ -340,6 +340,8 @@ class ReaderActivity : BaseRxActivity(), reader_menu_bottom.startAnimation(bottomAnimation) } } + else + reader_menu.visibility = View.GONE } menuStickyVisible = false } @@ -567,8 +569,10 @@ class ReaderActivity : BaseRxActivity(), if (visible) { coroutine = launchUI { delay(2000) - setMenuVisibility(false) - menuStickyVisible = false + if (systemUi?.isShowing == true) { + menuStickyVisible = false + setMenuVisibility(false) + } } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { window.navigationBarColor = getColor(android.R.color.transparent) @@ -585,6 +589,9 @@ class ReaderActivity : BaseRxActivity(), } } else { + if (menuStickyVisible && !menuVisible) { + setMenuVisibility(false, animate = false) + } coroutine?.cancel() } }