Skip to content

Commit c051910

Browse files
eriedclaude
andcommitted
Scan: virtual-wheel picker below real BLE devices
Move the simulator section to the end of the list. Riders looking for their wheel see real BLE results first; the test picker stays available but doesn't push real devices below the fold. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 95956c9 commit c051910

1 file changed

Lines changed: 48 additions & 49 deletions

File tree

app/src/main/java/com/eried/eucplanet/ui/scan/ScanScreen.kt

Lines changed: 48 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,54 @@ fun ScanScreen(
226226
val showVirtualPicker = BuildConfig.DEBUG || diagEnabled
227227

228228
LazyColumn(verticalArrangement = Arrangement.spacedBy(8.dp)) {
229-
// Virtual-wheel picker. Sits at the top so a phone with a
230-
// long list of real BLE devices in range doesn't bury it
231-
// below the fold. Shown in debug builds always, and in any
232-
// build when the user has Service Mode active.
229+
items(devices) { device ->
230+
Card(
231+
modifier = Modifier
232+
.fillMaxWidth()
233+
.clickable {
234+
selecting = true
235+
viewModel.selectDevice(device)
236+
onDeviceSelected()
237+
},
238+
colors = CardDefaults.cardColors(
239+
containerColor = MaterialTheme.colorScheme.surfaceVariant
240+
)
241+
) {
242+
Row(
243+
modifier = Modifier
244+
.fillMaxWidth()
245+
.padding(16.dp),
246+
verticalAlignment = Alignment.CenterVertically,
247+
horizontalArrangement = Arrangement.spacedBy(12.dp)
248+
) {
249+
Icon(
250+
Icons.Default.Bluetooth,
251+
contentDescription = null,
252+
tint = MaterialTheme.colorScheme.primary
253+
)
254+
Column(modifier = Modifier.weight(1f)) {
255+
Text(
256+
text = device.name,
257+
style = MaterialTheme.typography.titleLarge
258+
)
259+
Text(
260+
text = device.address,
261+
style = MaterialTheme.typography.bodyMedium,
262+
color = MaterialTheme.colorScheme.onSurfaceVariant
263+
)
264+
}
265+
Text(
266+
text = "${device.rssi} dBm",
267+
style = MaterialTheme.typography.bodyMedium,
268+
color = MaterialTheme.colorScheme.onSurfaceVariant
269+
)
270+
}
271+
}
272+
}
273+
274+
// Virtual-wheel picker. Sits below the real BLE list — riders looking
275+
// for their wheel see real devices first; the simulator section is for
276+
// testing and only available in debug builds or when Service Mode is on.
233277
if (showVirtualPicker) {
234278
item {
235279
Card(
@@ -326,51 +370,6 @@ fun ScanScreen(
326370
}
327371
}
328372
}
329-
330-
items(devices) { device ->
331-
Card(
332-
modifier = Modifier
333-
.fillMaxWidth()
334-
.clickable {
335-
selecting = true
336-
viewModel.selectDevice(device)
337-
onDeviceSelected()
338-
},
339-
colors = CardDefaults.cardColors(
340-
containerColor = MaterialTheme.colorScheme.surfaceVariant
341-
)
342-
) {
343-
Row(
344-
modifier = Modifier
345-
.fillMaxWidth()
346-
.padding(16.dp),
347-
verticalAlignment = Alignment.CenterVertically,
348-
horizontalArrangement = Arrangement.spacedBy(12.dp)
349-
) {
350-
Icon(
351-
Icons.Default.Bluetooth,
352-
contentDescription = null,
353-
tint = MaterialTheme.colorScheme.primary
354-
)
355-
Column(modifier = Modifier.weight(1f)) {
356-
Text(
357-
text = device.name,
358-
style = MaterialTheme.typography.titleLarge
359-
)
360-
Text(
361-
text = device.address,
362-
style = MaterialTheme.typography.bodyMedium,
363-
color = MaterialTheme.colorScheme.onSurfaceVariant
364-
)
365-
}
366-
Text(
367-
text = "${device.rssi} dBm",
368-
style = MaterialTheme.typography.bodyMedium,
369-
color = MaterialTheme.colorScheme.onSurfaceVariant
370-
)
371-
}
372-
}
373-
}
374373
}
375374
}
376375
}

0 commit comments

Comments
 (0)