From 28301d09b99a87dc63c788905e7e74b101f0faf8 Mon Sep 17 00:00:00 2001 From: Rafey Ahmad <71697384+glokta1@users.noreply.github.com> Date: Thu, 3 Feb 2022 01:56:53 +0530 Subject: [PATCH] Fix system bars in internal player (#378) --- .../java/eu/kanade/tachiyomi/ui/player/PlayerActivity.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/player/PlayerActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/player/PlayerActivity.kt index e9a9d3a51..204927938 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/player/PlayerActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/player/PlayerActivity.kt @@ -138,7 +138,6 @@ class PlayerActivity : AppCompatActivity() { setContentView(binding.root) - setVisibilities() playerView = binding.playerView playerView.resizeMode = preferences.getPlayerViewMode() youTubeDoubleTap = binding.youtubeOverlay @@ -334,6 +333,8 @@ class PlayerActivity : AppCompatActivity() { override fun create(): AlertDialog { return super.create().apply { val window = this.window ?: return@apply + window.setFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE) + val alertWindowInsetsController = WindowInsetsControllerCompat(window, window.decorView) alertWindowInsetsController.hide(WindowInsetsCompat.Type.systemBars()) alertWindowInsetsController.systemBarsBehavior = WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE @@ -595,6 +596,11 @@ class PlayerActivity : AppCompatActivity() { super.onStart() } + override fun onResume() { + super.onResume() + setVisibilities() + } + override fun onStop() { saveEpisodeHistory(EpisodeItem(episode, anime)) setEpisodeProgress(episode, anime, exoPlayer.currentPosition, exoPlayer.duration)