소스 검색

Make immersive mode slightly more reliable on rotation

arkon 5 년 전
부모
커밋
9dc184adff
1개의 변경된 파일10개의 추가작업 그리고 1개의 파일을 삭제
  1. 10 1
      app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt

+ 10 - 1
app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt

@@ -182,9 +182,18 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>() {
         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)