From 9dc184adffe4e7448f27a75109e5c662234f5ca4 Mon Sep 17 00:00:00 2001 From: arkon Date: Thu, 16 Apr 2020 22:00:10 -0400 Subject: [PATCH] Make immersive mode slightly more reliable on rotation --- .../eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 7d471497a..b5ce3ba2c 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 @@ -182,9 +182,18 @@ class ReaderActivity : BaseRxActivity() { super.onSaveInstanceState(outState) } + /** + * Set menu visibility again on activity resume to apply immersive mode again if needed. + * Helps with rotations. + */ + override fun onResume() { + super.onResume() + setMenuVisibility(menuVisible, animate = false) + } + /** * Called when the window focus changes. It sets the menu visibility to the last known state - * to apply again System UI (for immersive mode). + * to apply immersive mode again if needed. */ override fun onWindowFocusChanged(hasFocus: Boolean) { super.onWindowFocusChanged(hasFocus)