Fix system bars in internal player (#378)

This commit is contained in:
Rafey Ahmad 2022-02-03 01:56:53 +05:30 committed by GitHub
parent ad15b2157e
commit 28301d09b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -138,7 +138,6 @@ class PlayerActivity : AppCompatActivity() {
setContentView(binding.root) setContentView(binding.root)
setVisibilities()
playerView = binding.playerView playerView = binding.playerView
playerView.resizeMode = preferences.getPlayerViewMode() playerView.resizeMode = preferences.getPlayerViewMode()
youTubeDoubleTap = binding.youtubeOverlay youTubeDoubleTap = binding.youtubeOverlay
@ -334,6 +333,8 @@ class PlayerActivity : AppCompatActivity() {
override fun create(): AlertDialog { override fun create(): AlertDialog {
return super.create().apply { return super.create().apply {
val window = this.window ?: return@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) val alertWindowInsetsController = WindowInsetsControllerCompat(window, window.decorView)
alertWindowInsetsController.hide(WindowInsetsCompat.Type.systemBars()) alertWindowInsetsController.hide(WindowInsetsCompat.Type.systemBars())
alertWindowInsetsController.systemBarsBehavior = WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE alertWindowInsetsController.systemBarsBehavior = WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
@ -595,6 +596,11 @@ class PlayerActivity : AppCompatActivity() {
super.onStart() super.onStart()
} }
override fun onResume() {
super.onResume()
setVisibilities()
}
override fun onStop() { override fun onStop() {
saveEpisodeHistory(EpisodeItem(episode, anime)) saveEpisodeHistory(EpisodeItem(episode, anime))
setEpisodeProgress(episode, anime, exoPlayer.currentPosition, exoPlayer.duration) setEpisodeProgress(episode, anime, exoPlayer.currentPosition, exoPlayer.duration)