Show parent folders of subscribed folders

pull/180/head
M66B 5 years ago
parent 4898f2aceb
commit a0f74982bd

@ -996,17 +996,24 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
if (parents.size() > 0) if (parents.size() > 0)
Collections.sort(parents, parents.get(0).getComparator(context)); Collections.sort(parents, parents.get(0).getComparator(context));
for (TupleFolderEx parent : parents) for (TupleFolderEx parent : parents) {
if ((show_hidden || !parent.hide) && if (parent.hide && !show_hidden)
(!subscribed_only || continue;
parent.accountProtocol != EntityAccount.TYPE_IMAP ||
(parent.subscribed != null && parent.subscribed))) { List<TupleFolderEx> childs = null;
if (parent.child_refs != null)
childs = getHierarchical(parent.child_refs, indentation + 1);
if (!subscribed_only ||
parent.accountProtocol != EntityAccount.TYPE_IMAP ||
(parent.subscribed != null && parent.subscribed) ||
(childs != null && childs.size() > 0)) {
parent.indentation = indentation; parent.indentation = indentation;
result.add(parent); result.add(parent);
if (!parent.collapsed && childs != null)
if (!parent.collapsed && parent.child_refs != null) result.addAll(childs);
result.addAll(getHierarchical(parent.child_refs, indentation + 1));
} }
}
return result; return result;
} }

Loading…
Cancel
Save