feat: Add video recorder starting info

This commit is contained in:
Myzel394 2023-12-16 21:15:00 +01:00
parent a0640d13ab
commit ff8ea3e1f2
No known key found for this signature in database
GPG Key ID: 79CC92F37B3E1A2B
3 changed files with 16 additions and 7 deletions

View File

@ -11,6 +11,7 @@ import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.CameraAlt
import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.Divider
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
@ -99,12 +100,19 @@ fun VideoRecordingStatus(
}
}
RecordingStatus(
recordingTime = videoRecorder.recordingTime,
progress = videoRecorder.progress,
recordingStart = videoRecorder.recordingStart,
maxDuration = videoRecorder.settings.maxDuration,
)
if (videoRecorder.isStartingRecording) {
Text(
stringResource(R.string.ui_videoRecorder_info_starting),
style = MaterialTheme.typography.labelMedium,
)
} else {
RecordingStatus(
recordingTime = videoRecorder.recordingTime,
progress = videoRecorder.progress,
recordingStart = videoRecorder.recordingStart,
maxDuration = videoRecorder.settings.maxDuration,
)
}
Column(
verticalArrangement = Arrangement

View File

@ -11,7 +11,7 @@ import androidx.compose.runtime.setValue
@Composable
fun rememberInitialRecordingAnimation(recordingTime: Long): Boolean {
// Only show animation when the recording has just started
val recordingJustStarted = recordingTime <= 1L
val recordingJustStarted = recordingTime <= 3L
var progressVisible by rememberSaveable { mutableStateOf(!recordingJustStarted) }
LaunchedEffect(Unit) {

View File

@ -159,4 +159,5 @@
<string name="ui_recorder_info_startTime_short">Recording started at %s</string>
<string name="ui_recorder_info_startTime_full">Recording started %s</string>
<string name="ui_recorder_info_saveNowTime">Saving now will save until %s</string>
<string name="ui_videoRecorder_info_starting">Video Recorder is starting...</string>
</resources>