mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00: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:
parent
86dc8f2b1c
commit
df7ce09fdb
1 changed files with 5 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue