Merge pull request #11287 from osmandapp/fix_osmand_live_list_sorting

OsmAnd Live - correct list sorting
This commit is contained in:
Vitaliy 2021-03-30 11:21:09 +03:00 committed by GitHub
commit 124b701a9f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -415,7 +415,11 @@ public class LiveUpdatesFragment extends BaseOsmAndDialogFragment implements OnL
public int compare(LocalIndexInfo o1, LocalIndexInfo o2) { public int compare(LocalIndexInfo o1, LocalIndexInfo o2) {
CommonPreference<Boolean> preference1 = preferenceForLocalIndex(o1.getFileName(), getSettings()); CommonPreference<Boolean> preference1 = preferenceForLocalIndex(o1.getFileName(), getSettings());
CommonPreference<Boolean> preference2 = preferenceForLocalIndex(o2.getFileName(), getSettings()); CommonPreference<Boolean> preference2 = preferenceForLocalIndex(o2.getFileName(), getSettings());
return preference2.get().compareTo(preference1.get()); int prefSort = preference2.get().compareTo(preference1.get());
if (prefSort != 0) {
return prefSort;
}
return o1.compareTo(o2);
} }
}); });
notifyDataSetInvalidated(); notifyDataSetInvalidated();