Skip to content

Instantly share code, notes, and snippets.

@devstar0209
Last active March 4, 2024 02:19
Show Gist options
  • Save devstar0209/54f5d019e961359dbf3e53fe5b538134 to your computer and use it in GitHub Desktop.
Save devstar0209/54f5d019e961359dbf3e53fe5b538134 to your computer and use it in GitHub Desktop.
hideSystemUi is a helper method called in onResume, which allows you to have a full-screen experience.
@SuppressLint("InlinedApi")
private fun hideSystemUi() {
WindowCompat.setDecorFitsSystemWindows(window, false)
WindowInsetsControllerCompat(window, viewBinding.videoView).let { controller ->
controller.hide(WindowInsetsCompat.Type.systemBars())
controller.systemBarsBehavior = WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment