mirror of
https://github.com/Myzel394/Alibi.git
synced 2025-06-18 23:05:26 +02:00
feat: Add some optional delay to RecordingControl
This commit is contained in:
parent
76752e9004
commit
e719c0f8fb
@ -30,6 +30,7 @@ import kotlinx.coroutines.launch
|
||||
|
||||
@Composable
|
||||
fun RecordingControl(
|
||||
initialDelay: Long = 0L,
|
||||
isPaused: Boolean,
|
||||
recordingTime: Long,
|
||||
onDelete: () -> Unit,
|
||||
@ -67,6 +68,8 @@ fun RecordingControl(
|
||||
|
||||
LaunchedEffect(animateIn) {
|
||||
if (animateIn) {
|
||||
delay(initialDelay)
|
||||
|
||||
val stack = RandomStack.of(arrayOf(1, 2, 3).asIterable())
|
||||
|
||||
while (!stack.isEmpty()) {
|
||||
|
@ -142,6 +142,10 @@ fun VideoRecordingStatus(
|
||||
|
||||
if (!videoRecorder.isStartingRecording) {
|
||||
RecordingControl(
|
||||
// There may be some edge cases where the app may crash if the
|
||||
// user stops or pauses the recording too soon, so we simply add a
|
||||
// small delay to prevent that
|
||||
initialDelay = 1000L,
|
||||
isPaused = videoRecorder.isPaused,
|
||||
recordingTime = videoRecorder.recordingTime,
|
||||
onDelete = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user