Skip to content

Commit 37f5fb4

Browse files
committed
feat(ui): keep screen on in AOD mode
1 parent aea6a99 commit 37f5fb4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

app/src/main/java/org/nsh07/pomodoro/ui/AlwaysOnDisplay.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,15 @@ fun SharedTransitionScope.AlwaysOnDisplay(
6565
val insetsController = remember { WindowCompat.getInsetsController(window, view) }
6666

6767
DisposableEffect(Unit) {
68+
view.keepScreenOn = true
6869
insetsController.apply {
6970
hide(WindowInsetsCompat.Type.statusBars())
7071
hide(WindowInsetsCompat.Type.navigationBars())
7172
systemBarsBehavior =
7273
WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
7374
}
7475
onDispose {
76+
view.keepScreenOn = false
7577
insetsController.apply {
7678
show(WindowInsetsCompat.Type.statusBars())
7779
show(WindowInsetsCompat.Type.navigationBars())

0 commit comments

Comments
 (0)