mirror of
https://github.com/Myzel394/Alibi.git
synced 2025-06-19 07:15:25 +02:00
ui: Improve SettingsScreen batch setting
This commit is contained in:
parent
ab1fca418c
commit
dfa2cce148
@ -60,8 +60,8 @@ data class AudioRecorderSettings(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun setIntervalDuration(duration: Long): AudioRecorderSettings {
|
fun setIntervalDuration(duration: Long): AudioRecorderSettings {
|
||||||
if (duration < 10 * 1000L) {
|
if (duration < 30 * 1000L || duration > 60 * 60 * 1000L) {
|
||||||
throw Exception("Interval duration must be at least 10 seconds")
|
throw Exception("Interval duration must be between 30 seconds and 1 hour")
|
||||||
}
|
}
|
||||||
|
|
||||||
return copy(intervalDuration = duration)
|
return copy(intervalDuration = duration)
|
||||||
|
@ -9,6 +9,7 @@ import androidx.compose.foundation.layout.Column
|
|||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
import androidx.compose.foundation.layout.Spacer
|
import androidx.compose.foundation.layout.Spacer
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
|
import androidx.compose.foundation.layout.height
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.width
|
import androidx.compose.foundation.layout.width
|
||||||
import androidx.compose.foundation.layout.widthIn
|
import androidx.compose.foundation.layout.widthIn
|
||||||
@ -50,6 +51,7 @@ import app.myzel394.locationtest.dataStore
|
|||||||
import app.myzel394.locationtest.db.AppSettings
|
import app.myzel394.locationtest.db.AppSettings
|
||||||
import app.myzel394.locationtest.ui.components.GlobalSwitch
|
import app.myzel394.locationtest.ui.components.GlobalSwitch
|
||||||
import app.myzel394.locationtest.ui.utils.formatDuration
|
import app.myzel394.locationtest.ui.utils.formatDuration
|
||||||
|
import com.maxkeppeker.sheets.core.icons.LibIcons
|
||||||
import com.maxkeppeker.sheets.core.models.base.rememberUseCaseState
|
import com.maxkeppeker.sheets.core.models.base.rememberUseCaseState
|
||||||
import com.maxkeppeler.sheets.duration.DurationDialog
|
import com.maxkeppeler.sheets.duration.DurationDialog
|
||||||
import com.maxkeppeler.sheets.duration.models.DurationConfig
|
import com.maxkeppeler.sheets.duration.models.DurationConfig
|
||||||
@ -123,7 +125,7 @@ fun SettingsScreen(
|
|||||||
text = "Batch duration",
|
text = "Batch duration",
|
||||||
style = MaterialTheme.typography.labelLarge,
|
style = MaterialTheme.typography.labelLarge,
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.width(8.dp))
|
Spacer(modifier = Modifier.height(4.dp))
|
||||||
Text(
|
Text(
|
||||||
text = "Record a single batch for this duration. Alibi records multiple batches and deletes the oldest one. When exporting the audio, all batches will be merged together",
|
text = "Record a single batch for this duration. Alibi records multiple batches and deletes the oldest one. When exporting the audio, all batches will be merged together",
|
||||||
style = MaterialTheme.typography.bodySmall,
|
style = MaterialTheme.typography.bodySmall,
|
||||||
@ -145,8 +147,10 @@ fun SettingsScreen(
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
config = DurationConfig(
|
config = DurationConfig(
|
||||||
timeFormat = DurationFormat.HH_MM_SS,
|
timeFormat = DurationFormat.MM_SS,
|
||||||
currentTime = settings.audioRecorderSettings.intervalDuration / 1000,
|
currentTime = settings.audioRecorderSettings.intervalDuration / 1000,
|
||||||
|
minTime = 10,
|
||||||
|
maxTime = 60 * 60,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
Button(
|
Button(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user