Skip to content

Commit fd8cf0e

Browse files
eriedclaude
andcommitted
Settings scan cards: align with Volume Keys layout
Both Flic and External GPS scan sections now follow the Volume-Keys shape: hint sits outside the card as small italic body text (left aligned, default flow), action button sits inside the card and stretches fillMaxWidth so the two scans look identical and the tap target is unambiguous on every screen size. Removes the centred-Column / intrinsic-button-width pattern that made each integration look hand-styled relative to the rest of the Integration tab. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 4fd6062 commit fd8cf0e

2 files changed

Lines changed: 23 additions & 25 deletions

File tree

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

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ fun ExternalGpsSection(viewModel: ExternalGpsViewModel = hiltViewModel()) {
5252
SectionHeader(stringResource(R.string.section_external_gps))
5353

5454
if (pairedAddress == null) {
55-
// Not paired: scan card with start/stop and a list of discovered devices.
56-
// Mirrors the Flic scan card so the two integrations read as one family.
55+
// Match the Volume Keys / Flic layout: hint outside the card as small
56+
// italic text, action button inside the card, full width.
57+
HintText(stringResource(R.string.external_gps_caption), small = true)
5758
UnpairedExternalGpsCard(
5859
scanning = scanning,
5960
results = scanResults,
@@ -86,18 +87,13 @@ private fun UnpairedExternalGpsCard(
8687
colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.surfaceVariant),
8788
shape = RoundedCornerShape(12.dp)
8889
) {
89-
// Mirrors the Flic scan card: centered column, hint above the button,
90-
// intrinsic button width. Discovered devices appear as inset rows
91-
// between the hint and the action button.
9290
Column(
9391
modifier = Modifier
9492
.fillMaxWidth()
9593
.padding(16.dp),
96-
horizontalAlignment = Alignment.CenterHorizontally
94+
verticalArrangement = Arrangement.spacedBy(8.dp)
9795
) {
98-
HintText(stringResource(R.string.external_gps_caption))
9996
results.forEach { result ->
100-
Spacer(Modifier.height(8.dp))
10197
Card(
10298
colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.surface),
10399
shape = RoundedCornerShape(8.dp),
@@ -125,21 +121,20 @@ private fun UnpairedExternalGpsCard(
125121
}
126122
}
127123
if (scanning && results.isEmpty()) {
128-
Spacer(Modifier.height(8.dp))
129-
HintText(stringResource(R.string.external_gps_no_results))
124+
HintText(stringResource(R.string.external_gps_no_results), small = true)
130125
}
131-
Spacer(Modifier.height(12.dp))
132126
if (scanning) {
133-
CircularProgressIndicator(modifier = Modifier.padding(8.dp))
134-
Spacer(Modifier.height(8.dp))
127+
CircularProgressIndicator(modifier = Modifier.padding(vertical = 4.dp))
135128
Button(
136129
onClick = onStopScan,
130+
modifier = Modifier.fillMaxWidth(),
137131
colors = ButtonDefaults.buttonColors(containerColor = AccentRed)
138132
) { Text(stringResource(R.string.external_gps_stop_scan)) }
139133
} else {
140-
Button(onClick = onStartScan) {
141-
Text(stringResource(R.string.external_gps_pair_button))
142-
}
134+
Button(
135+
onClick = onStartScan,
136+
modifier = Modifier.fillMaxWidth()
137+
) { Text(stringResource(R.string.external_gps_pair_button)) }
143138
}
144139
}
145140
}

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

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -974,30 +974,33 @@ private fun FlicTab(
974974
}
975975

976976
// Scan section — only shown when there's an empty slot to fill.
977+
// Layout matches Volume Keys: hint sits outside the card as small italic
978+
// body text, action button sits inside the card and stretches full width
979+
// for an obvious tap target.
977980
val allSlotsFull = settings.flic1Address != null && settings.flic2Address != null &&
978981
settings.flic3Address != null && settings.flic4Address != null
979982
if (!allSlotsFull) {
983+
HintText(stringResource(R.string.flic_scan_hint), small = true)
980984
Card(
981985
colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.surfaceVariant),
982986
shape = RoundedCornerShape(12.dp)
983987
) {
984988
Column(
985-
modifier = Modifier.padding(16.dp),
986-
horizontalAlignment = Alignment.CenterHorizontally
989+
modifier = Modifier.padding(16.dp).fillMaxWidth(),
990+
verticalArrangement = Arrangement.spacedBy(8.dp)
987991
) {
988-
HintText(stringResource(R.string.flic_scan_hint))
989-
Spacer(Modifier.height(12.dp))
990992
if (scanning) {
991-
CircularProgressIndicator(modifier = Modifier.padding(8.dp))
992-
Spacer(Modifier.height(8.dp))
993+
CircularProgressIndicator(modifier = Modifier.padding(vertical = 4.dp))
993994
Button(
994995
onClick = { viewModel.stopScan() },
996+
modifier = Modifier.fillMaxWidth(),
995997
colors = ButtonDefaults.buttonColors(containerColor = AccentRed)
996998
) { Text(stringResource(R.string.flic_stop_scan)) }
997999
} else {
998-
Button(onClick = { viewModel.startScan() }) {
999-
Text(stringResource(R.string.flic_start_scan))
1000-
}
1000+
Button(
1001+
onClick = { viewModel.startScan() },
1002+
modifier = Modifier.fillMaxWidth()
1003+
) { Text(stringResource(R.string.flic_start_scan)) }
10011004
}
10021005
}
10031006
}

0 commit comments

Comments
 (0)