1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-01 14:32:54 +01:00

Prevent UI freeze when a folder has a lot of devices

Do not include the devices from collapsed folders in the array.
This commit is contained in:
José Rebelo 2023-06-14 21:24:24 +01:00
parent 5f0689d2e1
commit 1b44f3566e

View File

@ -163,8 +163,10 @@ public class GBDeviceAdapterv2 extends ListAdapter<GBDevice, GBDeviceAdapterv2.V
for (final Map.Entry<String, List<GBDevice>> folder : devicesPerFolder.entrySet()) {
enrichedList.add(new GBDeviceFolder(folder.getKey()));
if (folder.getKey().equals(expandedFolderName)) {
enrichedList.addAll(folder.getValue());
}
}
return enrichedList;
}
@ -213,6 +215,7 @@ public class GBDeviceAdapterv2 extends ListAdapter<GBDevice, GBDeviceAdapterv2.V
}else {
expandedFolderName = folder.getName();
}
rebuildFolders();
notifyDataSetChanged();
}
});