1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-26 01:28:50 -05:00

Running heavy operations on the UI thread makes K-9's UI slow and

freezy.  addOrUpdateMessages is very heavy. and very common.
This commit is contained in:
Jesse Vincent 2010-10-21 20:48:12 +00:00
parent 44e2857c3f
commit e05784d41d

View File

@ -2303,10 +2303,6 @@ public class MessageList
// the callbacks to mutate it. // the callbacks to mutate it.
final List<Message> messages = new ArrayList<Message>(providedMessages); final List<Message> messages = new ArrayList<Message>(providedMessages);
runOnUiThread(new Runnable()
{
public void run()
{
boolean needsSort = false; boolean needsSort = false;
final List<MessageInfoHolder> messagesToAdd = new ArrayList<MessageInfoHolder>(); final List<MessageInfoHolder> messagesToAdd = new ArrayList<MessageInfoHolder>();
List<MessageInfoHolder> messagesToRemove = new ArrayList<MessageInfoHolder>(); List<MessageInfoHolder> messagesToRemove = new ArrayList<MessageInfoHolder>();
@ -2391,8 +2387,6 @@ public class MessageList
mHandler.sortMessages(); mHandler.sortMessages();
mHandler.resetUnreadCount(); mHandler.resetUnreadCount();
} }
}
});
} }
public MessageInfoHolder getMessage(Message message) public MessageInfoHolder getMessage(Message message)
{ {