Skip to content

Commit bbe3317

Browse files
eriedclaude
andcommitted
Motor sound picker + Credits: layout polish
Move the engine-preview play button next to the "Engine type" label, and show the Sampled/Synth source tag inside the dropdown as a suffix so it reads with the selected preset. Credits dialog: bump Thanks and Resources rows to bodyMedium and add thin horizontal dividers between entries. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 947790c commit bbe3317

2 files changed

Lines changed: 66 additions & 56 deletions

File tree

app/src/main/java/com/eried/eucplanet/ui/dashboard/DashboardScreen.kt

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,15 +1015,22 @@ fun DashboardScreen(
10151015
"Ilya Shkolnik & WheelLog community" to "Public protocol research the KingSong, Begode and Veteran adapters draw on.",
10161016
"InMotion" to "For making my awesome V14."
10171017
)
1018-
credits.forEach { (name, why) ->
1018+
val dividerColor = MaterialTheme.colorScheme.outline.copy(alpha = 0.2f)
1019+
credits.forEachIndexed { idx, (name, why) ->
1020+
if (idx > 0) {
1021+
androidx.compose.material3.HorizontalDivider(
1022+
color = dividerColor,
1023+
thickness = 0.5.dp
1024+
)
1025+
}
10191026
Row(
10201027
modifier = Modifier
10211028
.fillMaxWidth()
1022-
.padding(vertical = 3.dp)
1029+
.padding(vertical = 6.dp)
10231030
) {
10241031
Text(
10251032
name,
1026-
style = MaterialTheme.typography.bodySmall.copy(
1033+
style = MaterialTheme.typography.bodyMedium.copy(
10271034
fontWeight = FontWeight.SemiBold
10281035
),
10291036
modifier = Modifier.weight(0.42f),
@@ -1032,7 +1039,7 @@ fun DashboardScreen(
10321039
Spacer(Modifier.width(8.dp))
10331040
Text(
10341041
why,
1035-
style = MaterialTheme.typography.bodySmall,
1042+
style = MaterialTheme.typography.bodyMedium,
10361043
modifier = Modifier.weight(0.58f),
10371044
color = MaterialTheme.colorScheme.onSurfaceVariant
10381045
)
@@ -1053,15 +1060,21 @@ fun DashboardScreen(
10531060
"Flic2 SDK" to "Shortcut Labs. Used for hardware Flic button integration.",
10541061
"Play services (location, wearable)" to "Google. Apache 2.0. GPS and watch companion data layer."
10551062
)
1056-
resources.forEach { (name, why) ->
1063+
resources.forEachIndexed { idx, (name, why) ->
1064+
if (idx > 0) {
1065+
androidx.compose.material3.HorizontalDivider(
1066+
color = dividerColor,
1067+
thickness = 0.5.dp
1068+
)
1069+
}
10571070
Row(
10581071
modifier = Modifier
10591072
.fillMaxWidth()
1060-
.padding(vertical = 3.dp)
1073+
.padding(vertical = 6.dp)
10611074
) {
10621075
Text(
10631076
name,
1064-
style = MaterialTheme.typography.bodySmall.copy(
1077+
style = MaterialTheme.typography.bodyMedium.copy(
10651078
fontWeight = FontWeight.SemiBold
10661079
),
10671080
modifier = Modifier.weight(0.42f),
@@ -1070,7 +1083,7 @@ fun DashboardScreen(
10701083
Spacer(Modifier.width(8.dp))
10711084
Text(
10721085
why,
1073-
style = MaterialTheme.typography.bodySmall,
1086+
style = MaterialTheme.typography.bodyMedium,
10741087
modifier = Modifier.weight(0.58f),
10751088
color = MaterialTheme.colorScheme.onSurfaceVariant
10761089
)

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

Lines changed: 45 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2068,63 +2068,60 @@ private fun EngineTypePicker(
20682068
Text(
20692069
stringResource(R.string.engine_type_label),
20702070
style = MaterialTheme.typography.bodyMedium,
2071-
color = MaterialTheme.colorScheme.onSurfaceVariant,
2072-
modifier = Modifier.weight(1f)
2073-
)
2074-
Text(
2075-
sourceLabel,
2076-
style = MaterialTheme.typography.labelSmall,
2077-
color = MaterialTheme.colorScheme.primary
2071+
color = MaterialTheme.colorScheme.onSurfaceVariant
20782072
)
2073+
Spacer(Modifier.width(4.dp))
2074+
PlayButton(onClick = { onPreview(currentKey) })
20792075
}
20802076
Spacer(Modifier.height(6.dp))
2081-
Row(
2082-
modifier = Modifier.fillMaxWidth(),
2083-
verticalAlignment = Alignment.CenterVertically
2077+
ExposedDropdownMenuBox(
2078+
expanded = expanded,
2079+
onExpandedChange = { expanded = !expanded },
2080+
modifier = Modifier.fillMaxWidth()
20842081
) {
2085-
ExposedDropdownMenuBox(
2082+
OutlinedTextField(
2083+
value = displayFor(currentKey),
2084+
onValueChange = {},
2085+
readOnly = true,
2086+
suffix = {
2087+
Text(
2088+
sourceLabel,
2089+
style = MaterialTheme.typography.labelSmall,
2090+
color = MaterialTheme.colorScheme.primary
2091+
)
2092+
},
2093+
trailingIcon = { ExposedDropdownMenuDefaults.TrailingIcon(expanded = expanded) },
2094+
modifier = Modifier
2095+
.fillMaxWidth()
2096+
.menuAnchor(MenuAnchorType.PrimaryNotEditable, true)
2097+
)
2098+
ExposedDropdownMenu(
20862099
expanded = expanded,
2087-
onExpandedChange = { expanded = !expanded },
2088-
modifier = Modifier.weight(1f)
2100+
onDismissRequest = { expanded = false }
20892101
) {
2090-
OutlinedTextField(
2091-
value = displayFor(currentKey),
2092-
onValueChange = {},
2093-
readOnly = true,
2094-
trailingIcon = { ExposedDropdownMenuDefaults.TrailingIcon(expanded = expanded) },
2095-
modifier = Modifier
2096-
.fillMaxWidth()
2097-
.menuAnchor(MenuAnchorType.PrimaryNotEditable, true)
2098-
)
2099-
ExposedDropdownMenu(
2100-
expanded = expanded,
2101-
onDismissRequest = { expanded = false }
2102-
) {
2103-
profiles.forEach { p ->
2104-
DropdownMenuItem(
2105-
text = {
2106-
Row(verticalAlignment = Alignment.CenterVertically) {
2107-
Text(displayFor(p.key), modifier = Modifier.weight(1f))
2108-
Spacer(Modifier.width(8.dp))
2109-
Text(
2110-
if (p.sampleAssetBase != null)
2111-
stringResource(R.string.engine_source_sampled)
2112-
else
2113-
stringResource(R.string.engine_source_synth),
2114-
style = MaterialTheme.typography.labelSmall,
2115-
color = MaterialTheme.colorScheme.onSurfaceVariant
2116-
)
2117-
}
2118-
},
2119-
onClick = {
2120-
onSelect(p.key)
2121-
expanded = false
2102+
profiles.forEach { p ->
2103+
DropdownMenuItem(
2104+
text = {
2105+
Row(verticalAlignment = Alignment.CenterVertically) {
2106+
Text(displayFor(p.key), modifier = Modifier.weight(1f))
2107+
Spacer(Modifier.width(8.dp))
2108+
Text(
2109+
if (p.sampleAssetBase != null)
2110+
stringResource(R.string.engine_source_sampled)
2111+
else
2112+
stringResource(R.string.engine_source_synth),
2113+
style = MaterialTheme.typography.labelSmall,
2114+
color = MaterialTheme.colorScheme.onSurfaceVariant
2115+
)
21222116
}
2123-
)
2124-
}
2117+
},
2118+
onClick = {
2119+
onSelect(p.key)
2120+
expanded = false
2121+
}
2122+
)
21252123
}
21262124
}
2127-
PlayButton(onClick = { onPreview(currentKey) })
21282125
}
21292126
}
21302127
}

0 commit comments

Comments
 (0)