Skip to content

Commit c99cd3a

Browse files
eriedclaude
andcommitted
Motor sound: promote to its own settings tab
Pulled out of "Voice & announces" so the engine settings are reachable in one tap, and the voice tab isn't dominated by a feature that has nothing to do with TTS. Reuses the existing "Motor sound" string for the tab title and drops the now-redundant inner section header. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 08f2117 commit c99cd3a

1 file changed

Lines changed: 21 additions & 5 deletions

File tree

app/src/main/java/com/eried/eucplanet/ui/settings/SettingsScreen.kt

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import androidx.compose.material.icons.filled.DisplaySettings
3434
import androidx.compose.material.icons.filled.DragHandle
3535
import androidx.compose.material.icons.filled.Edit
3636
import androidx.compose.material.icons.filled.Extension
37+
import androidx.compose.material.icons.filled.GraphicEq
3738
import androidx.compose.material.icons.filled.Watch
3839
import androidx.compose.material.icons.filled.KeyboardArrowDown
3940
import androidx.compose.material.icons.filled.KeyboardArrowUp
@@ -219,6 +220,7 @@ fun SettingsScreen(
219220
val titleDisplay = stringResource(R.string.tab_display)
220221
val titleSpeed = stringResource(R.string.tab_speed)
221222
val titleVoice = stringResource(R.string.tab_voice)
223+
val titleMotor = stringResource(R.string.section_engine_sound)
222224
val titleCloud = stringResource(R.string.tab_cloud)
223225
val titleAlarms = stringResource(R.string.tab_alarms)
224226
val titleAuto = stringResource(R.string.tab_auto)
@@ -281,6 +283,20 @@ fun SettingsScreen(
281283
stringResource(R.string.report_time)
282284
).joinToString(" ")
283285

286+
val corpusMotor = listOf(
287+
titleMotor,
288+
stringResource(R.string.engine_sound_enabled),
289+
stringResource(R.string.engine_type_label),
290+
stringResource(R.string.engine_volume),
291+
stringResource(R.string.engine_muffler_label),
292+
stringResource(R.string.engine_gearbox_label),
293+
stringResource(R.string.engine_idle_label),
294+
stringResource(R.string.engine_decel_label),
295+
stringResource(R.string.engine_brake_label),
296+
stringResource(R.string.engine_duck_label),
297+
stringResource(R.string.engine_headphones_only)
298+
).joinToString(" ")
299+
284300
val corpusCloud = listOf(
285301
titleCloud,
286302
stringResource(R.string.section_cloud_folder),
@@ -330,6 +346,9 @@ fun SettingsScreen(
330346
SectionDef("voice", titleVoice, Icons.Default.RecordVoiceOver, corpusVoice) {
331347
VoiceTab(settings, viewModel)
332348
},
349+
SectionDef("motor", titleMotor, Icons.Default.GraphicEq, corpusMotor) {
350+
EngineSoundSection(settings, viewModel)
351+
},
333352
SectionDef("cloud", titleCloud, Icons.Default.Archive, corpusCloud) {
334353
CloudTab(settings, viewModel)
335354
},
@@ -716,8 +735,6 @@ private fun VoiceTab(
716735
onChange = { viewModel.updateVoiceOutputChannel(it) }
717736
)
718737

719-
EngineSoundSection(settings = settings, viewModel = viewModel)
720-
721738
SectionHeader(stringResource(R.string.section_announcements))
722739

723740
SwitchSetting(stringResource(R.string.voice_enabled), settings.voiceEnabled) {
@@ -1886,9 +1903,7 @@ private fun EngineSoundSection(
18861903
) {
18871904
var showSafety by remember { mutableStateOf(false) }
18881905

1889-
androidx.compose.material3.HorizontalDivider(color = MaterialTheme.colorScheme.outline.copy(alpha = 0.2f))
1890-
SectionHeader(stringResource(R.string.section_engine_sound))
1891-
1906+
Column(verticalArrangement = Arrangement.spacedBy(16.dp)) {
18921907
SwitchSetting(
18931908
label = stringResource(R.string.engine_sound_enabled),
18941909
checked = settings.engineSoundEnabled
@@ -1997,6 +2012,7 @@ private fun EngineSoundSection(
19972012
color = MaterialTheme.colorScheme.onSurfaceVariant
19982013
)
19992014
}
2015+
}
20002016

20012017
if (showSafety) {
20022018
AlertDialog(

0 commit comments

Comments
 (0)