mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-02-15 18:23:18 -05:00
feat: sort device list while keeping None (Disabled) at the top of the list (#1309)
Signed-off-by: Matthew Bogner <matt@ibogner.net>
This commit is contained in:
@@ -360,7 +360,11 @@ class SettingsFragment : ScreenFragment("Settings"), Logging {
|
||||
if (devices == null) return
|
||||
|
||||
var hasShownOurDevice = false
|
||||
devices.values.forEach { device ->
|
||||
devices.values
|
||||
// Display the device list in alphabetical order while keeping the "None (Disabled)"
|
||||
// device (fullAddress == n) at the top
|
||||
.sortedBy { dle -> if (dle.fullAddress == "n") "0" else dle.name }
|
||||
.forEach { device ->
|
||||
if (device.fullAddress == scanModel.selectedNotNull)
|
||||
hasShownOurDevice = true
|
||||
addDeviceButton(device, true)
|
||||
|
||||
Reference in New Issue
Block a user