mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-16 22:45:04 -05:00
First pass at a sane "restore list state" behavior when going back to a
messagelist from a message view
This commit is contained in:
parent
78f797dda8
commit
945bccd633
@ -21,6 +21,7 @@ public class MessageInfoHolder
|
|||||||
public boolean flagged;
|
public boolean flagged;
|
||||||
public boolean downloaded;
|
public boolean downloaded;
|
||||||
public boolean partially_downloaded;
|
public boolean partially_downloaded;
|
||||||
|
public boolean dirty;
|
||||||
public Message message;
|
public Message message;
|
||||||
public FolderInfoHolder folder;
|
public FolderInfoHolder folder;
|
||||||
public boolean selected;
|
public boolean selected;
|
||||||
|
@ -771,11 +771,11 @@ public class MessageList
|
|||||||
|
|
||||||
mController.addListener(mAdapter.mListener);
|
mController.addListener(mAdapter.mListener);
|
||||||
mAdapter.messages.clear();
|
mAdapter.messages.clear();
|
||||||
mAdapter.notifyDataSetChanged();
|
mAdapter.markAllMessagesAsDirty();
|
||||||
|
|
||||||
if (mFolderName != null)
|
if (mFolderName != null)
|
||||||
{
|
{
|
||||||
mController.listLocalMessages(mAccount, mFolderName, mAdapter.mListener);
|
mController.listLocalMessagesSynchronous(mAccount, mFolderName, mAdapter.mListener);
|
||||||
mController.notifyAccountCancel(this, mAccount);
|
mController.notifyAccountCancel(this, mAccount);
|
||||||
|
|
||||||
MessagingController.getInstance(getApplication()).notifyAccountCancel(this, mAccount);
|
MessagingController.getInstance(getApplication()).notifyAccountCancel(this, mAccount);
|
||||||
@ -788,6 +788,8 @@ public class MessageList
|
|||||||
}
|
}
|
||||||
|
|
||||||
mHandler.refreshTitle();
|
mHandler.refreshTitle();
|
||||||
|
mAdapter.pruneDirtyMessages();
|
||||||
|
mAdapter.notifyDataSetChanged();
|
||||||
|
|
||||||
restoreListState();
|
restoreListState();
|
||||||
}
|
}
|
||||||
@ -2241,6 +2243,24 @@ public class MessageList
|
|||||||
mAnsweredIcon = getResources().getDrawable(R.drawable.ic_mms_answered_small);
|
mAnsweredIcon = getResources().getDrawable(R.drawable.ic_mms_answered_small);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void markAllMessagesAsDirty()
|
||||||
|
{
|
||||||
|
for (MessageInfoHolder holder : mAdapter.messages)
|
||||||
|
{
|
||||||
|
holder.dirty = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void pruneDirtyMessages()
|
||||||
|
{
|
||||||
|
for (MessageInfoHolder holder : mAdapter.messages)
|
||||||
|
{
|
||||||
|
if (holder.dirty)
|
||||||
|
{
|
||||||
|
removeMessage(holder);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void removeMessages(List<MessageInfoHolder> holders)
|
public void removeMessages(List<MessageInfoHolder> holders)
|
||||||
{
|
{
|
||||||
if (holders != null)
|
if (holders != null)
|
||||||
|
Loading…
Reference in New Issue
Block a user