mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-24 02:12:15 -05:00
When we sync messages and are displaying a messagelist, do the listview
updates on the UI thread rather than the sync thread. This is a huge performance boost (based on simple empirical testing) for initial syncs as we now do more work as we add messages to message lists
This commit is contained in:
parent
db1b86a296
commit
7bd8fc3599
@ -2054,8 +2054,12 @@ public class MessageList
|
||||
addOrUpdateMessages(account, folder, messages, verifyAgainstSearch);
|
||||
}
|
||||
|
||||
private void addOrUpdateMessages(Account account, String folder, List<Message> messages, boolean verifyAgainstSearch)
|
||||
private void addOrUpdateMessages(final Account account, final String folder, final List<Message> messages, final boolean verifyAgainstSearch)
|
||||
{
|
||||
runOnUiThread(new Runnable()
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
boolean needsSort = false;
|
||||
final List<MessageInfoHolder> messagesToAdd = new ArrayList<MessageInfoHolder>();
|
||||
List<MessageInfoHolder> messagesToRemove = new ArrayList<MessageInfoHolder>();
|
||||
@ -2130,7 +2134,10 @@ public class MessageList
|
||||
mHandler.resetUnreadCount();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
public MessageInfoHolder getMessage(Message message)
|
||||
{
|
||||
return getMessage(message.makeMessageReference());
|
||||
|
Loading…
Reference in New Issue
Block a user