Browse Source

Merge pull request #527 from twig/unlabelled_top

show unlabelled torrents at the top of filter list
pull/533/head
Eric Kok 4 years ago committed by GitHub
parent
commit
397a8228c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  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 @@ -101,13 +101,17 @@ public class Label implements SimpleListItem, NavigationFilter, Comparable<Label
}
ArrayList<Label> localLabels = new ArrayList<>();
unnamedLabelText = unnamedLabel;
localLabels.add(new Label(unnamedLabel, -1, true));
for (org.transdroid.daemon.Label label : daemonLabels) {
if (label != null && !TextUtils.isEmpty(label.getName())) {
localLabels.add(new Label(label));
}
}
Collections.sort(localLabels);
// force unlabelled to be at the top
localLabels.add(0, new Label(unnamedLabel, -1, true));
return localLabels;
}

Loading…
Cancel
Save