mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-16 22:45:04 -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:
parent
44e2857c3f
commit
e05784d41d
@ -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>();
|
||||||
@ -2392,8 +2388,6 @@ public class MessageList
|
|||||||
mHandler.resetUnreadCount();
|
mHandler.resetUnreadCount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
|
||||||
public MessageInfoHolder getMessage(Message message)
|
public MessageInfoHolder getMessage(Message message)
|
||||||
{
|
{
|
||||||
return getMessage(message.makeMessageReference());
|
return getMessage(message.makeMessageReference());
|
||||||
|
Loading…
Reference in New Issue
Block a user