mirror of
https://github.com/Myzel394/Alibi.git
synced 2025-06-19 07:15:25 +02:00
feat: Keep screen on while recording
This commit is contained in:
parent
491a0740f1
commit
96106cd79c
@ -41,6 +41,7 @@ import app.myzel394.locationtest.ui.BIG_PRIMARY_BUTTON_SIZE
|
|||||||
import app.myzel394.locationtest.ui.components.AudioRecorder.atoms.ConfirmDeletionDialog
|
import app.myzel394.locationtest.ui.components.AudioRecorder.atoms.ConfirmDeletionDialog
|
||||||
import app.myzel394.locationtest.ui.components.AudioRecorder.atoms.RealtimeAudioVisualizer
|
import app.myzel394.locationtest.ui.components.AudioRecorder.atoms.RealtimeAudioVisualizer
|
||||||
import app.myzel394.locationtest.ui.components.atoms.Pulsating
|
import app.myzel394.locationtest.ui.components.atoms.Pulsating
|
||||||
|
import app.myzel394.locationtest.ui.utils.KeepScreenOn
|
||||||
import app.myzel394.locationtest.ui.utils.formatDuration
|
import app.myzel394.locationtest.ui.utils.formatDuration
|
||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
import java.io.File
|
import java.io.File
|
||||||
@ -68,6 +69,8 @@ fun RecordingStatus(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
KeepScreenOn()
|
||||||
|
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize(),
|
.fillMaxSize(),
|
||||||
|
@ -0,0 +1,16 @@
|
|||||||
|
package app.myzel394.locationtest.ui.utils
|
||||||
|
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.runtime.DisposableEffect
|
||||||
|
import androidx.compose.ui.platform.LocalView
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun KeepScreenOn() {
|
||||||
|
val currentView = LocalView.current
|
||||||
|
DisposableEffect(Unit) {
|
||||||
|
currentView.keepScreenOn = true
|
||||||
|
onDispose {
|
||||||
|
currentView.keepScreenOn = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user