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
1 changed files with 9 additions and 2 deletions
|
@ -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 a new issue