mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-11 12:05:06 -05:00
Optimize the new return-to-listview code. (Avoid a bug where we do far
too much work on first open of a message list)
This commit is contained in:
parent
1421dcfbd3
commit
6249c4a81c
@ -771,7 +771,6 @@ public class MessageList
|
|||||||
sortDateAscending = mController.isSortAscending(SORT_TYPE.SORT_DATE);
|
sortDateAscending = mController.isSortAscending(SORT_TYPE.SORT_DATE);
|
||||||
|
|
||||||
mController.addListener(mAdapter.mListener);
|
mController.addListener(mAdapter.mListener);
|
||||||
mAdapter.markAllMessagesAsDirty();
|
|
||||||
|
|
||||||
if (mFolderName != null)
|
if (mFolderName != null)
|
||||||
{
|
{
|
||||||
@ -781,7 +780,10 @@ public class MessageList
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
mAdapter.markAllMessagesAsDirty();
|
||||||
mController.listLocalMessagesSynchronous(mAccount, mFolderName, mAdapter.mListener);
|
mController.listLocalMessagesSynchronous(mAccount, mFolderName, mAdapter.mListener);
|
||||||
|
mAdapter.pruneDirtyMessages();
|
||||||
|
mAdapter.notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
mController.notifyAccountCancel(this, mAccount);
|
mController.notifyAccountCancel(this, mAccount);
|
||||||
|
|
||||||
@ -795,8 +797,6 @@ public class MessageList
|
|||||||
}
|
}
|
||||||
|
|
||||||
mHandler.refreshTitle();
|
mHandler.refreshTitle();
|
||||||
mAdapter.pruneDirtyMessages();
|
|
||||||
mAdapter.notifyDataSetChanged();
|
|
||||||
|
|
||||||
restoreListState();
|
restoreListState();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user