mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-27 11:42:16 -05:00
Fixes Issue 3177
Dynamically update the FolderList titlebar when the unread state of a listed folder changes. This implementation applies the folder unread count delta to the account-level unread count, to avoid the expense of recomputing the entire account's unread count. If no FolderInfoHolder for this folder already exists, skip the recomputation of the account-level unread message count.
This commit is contained in:
parent
50e6218c1d
commit
c67ac4735f
@ -889,6 +889,8 @@ public class FolderList extends K9ListActivity {
|
||||
int unreadMessageCount = localFolder.getUnreadMessageCount();
|
||||
FolderInfoHolder folderHolder = getFolder(folderName);
|
||||
if (folderHolder != null) {
|
||||
int oldUnreadMessageCount = folderHolder.unreadMessageCount;
|
||||
mUnreadMessageCount += unreadMessageCount - oldUnreadMessageCount;
|
||||
folderHolder.populate(context, localFolder, mAccount, unreadMessageCount);
|
||||
mHandler.dataChanged();
|
||||
}
|
||||
@ -959,6 +961,7 @@ public class FolderList extends K9ListActivity {
|
||||
public void folderStatusChanged(Account account, String folderName, int unreadMessageCount) {
|
||||
if (account.equals(mAccount)) {
|
||||
refreshFolder(account, folderName);
|
||||
informUserOfStatus();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user