Contribute child folder unread to collapsed parent

This commit is contained in:
M66B
2021-02-27 19:21:28 +01:00
parent 664220a1f3
commit 7b58d770c1
2 changed files with 9 additions and 3 deletions

View File

@@ -276,10 +276,11 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
ivNotify.setVisibility(folder.notify ? View.VISIBLE : View.GONE);
}
if (folder.unseen > 0)
int unseen = folder.unseen + (folder.collapsed ? folder.childs_unseen : 0);
if (unseen > 0)
tvName.setText(context.getString(R.string.title_name_count,
folder.getDisplayName(context, folder.parent_ref == null ? null : folder.parent_ref),
NF.format(folder.unseen)));
NF.format(unseen)));
else
tvName.setText(folder.getDisplayName(context, folder.parent_ref));
@@ -1225,8 +1226,11 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
continue;
List<TupleFolderEx> childs = null;
if (parent.child_refs != null)
if (parent.child_refs != null) {
childs = getHierarchical(parent.child_refs, indentation + 1);
for (TupleFolderEx child : childs)
parent.childs_unseen += child.unseen + child.childs_unseen;
}
if (!subscribed_only ||
parent.accountProtocol != EntityAccount.TYPE_IMAP ||