mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-27 23:40:33 +05:30
Hide the status bar when hiding the controllers
This commit is contained in:
parent
3da6b0678a
commit
fbf9c30e9a
@ -205,6 +205,7 @@ internal class CustomExoPlayerView(
|
|||||||
// remove the callback to hide the controller
|
// remove the callback to hide the controller
|
||||||
handler.removeCallbacks(hideControllerRunnable)
|
handler.removeCallbacks(hideControllerRunnable)
|
||||||
super.hideController()
|
super.hideController()
|
||||||
|
(context as? MainActivity)?.windowHelper?.hideStatusBar()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun showController() {
|
override fun showController() {
|
||||||
|
@ -46,4 +46,12 @@ class WindowHelper(private val activity: BaseActivity) {
|
|||||||
|
|
||||||
window.clearFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS)
|
window.clearFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun hideStatusBar() = activity.apply {
|
||||||
|
WindowInsetsControllerCompat(window, window.decorView).hide(WindowInsetsCompat.Type.statusBars())
|
||||||
|
}
|
||||||
|
|
||||||
|
fun showStatusBar() = activity.apply {
|
||||||
|
WindowInsetsControllerCompat(window, window.decorView).show(WindowInsetsCompat.Type.statusBars())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user