Skip to content

Commit

Permalink
fix fullscreen for old android version
Browse files Browse the repository at this point in the history
  • Loading branch information
fakeyatogod committed Sep 2, 2023
1 parent 6646b3a commit 2cdfe79
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,9 @@ class PlayerFragment : Fragment() {
WindowCompat.setDecorFitsSystemWindows(requireActivity().window, true)
WindowInsetsControllerCompat(requireActivity().window, requireActivity().window.decorView)
.show(WindowInsetsCompat.Type.systemBars())
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S_V2)
requireActivity().window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN)

}

private fun hideSystemUi() {
Expand All @@ -452,6 +455,9 @@ class PlayerFragment : Fragment() {
controller.systemBarsBehavior =
WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
}
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S_V2)
requireActivity().window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN)

}


Expand Down

0 comments on commit 2cdfe79

Please sign in to comment.