feat(ui): keep screen on in AOD mode

This commit is contained in:
Nishant Mishra
2025-10-20 14:02:48 +05:30
parent aea6a9902e
commit 37f5fb433e

View File

@@ -65,6 +65,7 @@ fun SharedTransitionScope.AlwaysOnDisplay(
val insetsController = remember { WindowCompat.getInsetsController(window, view) }
DisposableEffect(Unit) {
view.keepScreenOn = true
insetsController.apply {
hide(WindowInsetsCompat.Type.statusBars())
hide(WindowInsetsCompat.Type.navigationBars())
@@ -72,6 +73,7 @@ fun SharedTransitionScope.AlwaysOnDisplay(
WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
}
onDispose {
view.keepScreenOn = false
insetsController.apply {
show(WindowInsetsCompat.Type.statusBars())
show(WindowInsetsCompat.Type.navigationBars())