Browse Source

- show unlabelled torrents at the top of filter list

pull/527/head
Twig N 5 years ago
parent
commit
3da0c25b19
  1. 6
      app/src/main/java/org/transdroid/core/gui/navigation/Label.java

6
app/src/main/java/org/transdroid/core/gui/navigation/Label.java

@ -101,13 +101,17 @@ public class Label implements SimpleListItem, NavigationFilter, Comparable<Label
} }
ArrayList<Label> localLabels = new ArrayList<>(); ArrayList<Label> localLabels = new ArrayList<>();
unnamedLabelText = unnamedLabel; unnamedLabelText = unnamedLabel;
localLabels.add(new Label(unnamedLabel, -1, true));
for (org.transdroid.daemon.Label label : daemonLabels) { for (org.transdroid.daemon.Label label : daemonLabels) {
if (label != null && !TextUtils.isEmpty(label.getName())) { if (label != null && !TextUtils.isEmpty(label.getName())) {
localLabels.add(new Label(label)); localLabels.add(new Label(label));
} }
} }
Collections.sort(localLabels); Collections.sort(localLabels);
// force unlabelled to be at the top
localLabels.add(0, new Label(unnamedLabel, -1, true));
return localLabels; return localLabels;
} }

Loading…
Cancel
Save