mirror of
https://github.com/Myzel394/Alibi.git
synced 2025-06-18 23:05:26 +02:00
feat: Add save current option to VideoRecordingStatus
Signed-off-by: Myzel394 <50424412+Myzel394@users.noreply.github.com>
This commit is contained in:
parent
a39efe8f68
commit
227e075c0b
@ -21,6 +21,7 @@ import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.rememberCoroutineScope
|
||||
import androidx.compose.runtime.saveable.rememberSaveable
|
||||
import androidx.compose.runtime.setValue
|
||||
@ -33,6 +34,7 @@ import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
import app.myzel394.alibi.R
|
||||
import app.myzel394.alibi.dataStore
|
||||
import app.myzel394.alibi.ui.components.RecorderScreen.atoms.SaveCurrentNowModal
|
||||
import app.myzel394.alibi.ui.components.RecorderScreen.atoms.TorchStatus
|
||||
import app.myzel394.alibi.ui.components.RecorderScreen.molecules.RecordingControl
|
||||
import app.myzel394.alibi.ui.components.RecorderScreen.molecules.RecordingStatus
|
||||
@ -193,6 +195,25 @@ fun _PrimitiveControls(videoRecorder: VideoRecorderModel) {
|
||||
val dataStore = context.dataStore
|
||||
val scope = rememberCoroutineScope()
|
||||
|
||||
var showConfirmSaveNow by remember { mutableStateOf(false) }
|
||||
|
||||
if (showConfirmSaveNow) {
|
||||
SaveCurrentNowModal(
|
||||
onDismiss = {
|
||||
showConfirmSaveNow = false
|
||||
},
|
||||
onConfirm = {
|
||||
showConfirmSaveNow = false
|
||||
|
||||
scope.launch {
|
||||
videoRecorder.recorderService!!.startNewCycle()
|
||||
|
||||
videoRecorder.onRecordingSave(false).join()
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
RecordingControl(
|
||||
orientation = Configuration.ORIENTATION_PORTRAIT,
|
||||
// There may be some edge cases where the app may crash if the
|
||||
@ -235,7 +256,7 @@ fun _PrimitiveControls(videoRecorder: VideoRecorderModel) {
|
||||
}
|
||||
},
|
||||
onSaveCurrent = {
|
||||
//TODO
|
||||
showConfirmSaveNow = true
|
||||
}
|
||||
)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user