1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-08-13 17:03:48 -04:00

Added unset functionality to batch 'Read' and 'Flag' buttons. We are giving priority to setting the flags. So unsetting only happens if all selected messages do not have the flag set.

This commit is contained in:
Bao-Long Nguyen-Trong 2009-12-01 00:50:19 +00:00
parent 1593678cfe
commit e354ba17b6

View File

@ -2249,7 +2249,7 @@ public class MessageList
@Override
public void onClick(View v)
{
boolean newState = false;
List<Message> messageList = new ArrayList<Message>();
for (MessageInfoHolder holder : mAdapter.messages)
{
@ -2261,16 +2261,38 @@ public class MessageList
}
else if (v == mBatchFlagButton)
{
holder.flagged = true;
if (!holder.flagged) {
newState = true;
}
}
else if (v == mBatchReadButton)
{
holder.read = true;
if (!holder.read) {
newState = true;
}
}
messageList.add(holder.message);
}
}
for (MessageInfoHolder holder : mAdapter.messages)
{
if (holder.selected)
{
if (v == mBatchDeleteButton)
{
//nothing
}
else if (v == mBatchFlagButton)
{
holder.flagged = newState;
}
else if (v == mBatchReadButton)
{
holder.read = newState;
}
}
}
if (!messageList.isEmpty())
{
@ -2283,7 +2305,7 @@ public class MessageList
else
{
MessagingController.getInstance(getApplication()).setFlag(mAccount, mCurrentFolder.name, messageList.toArray(new Message[0]),
(v == mBatchReadButton ? Flag.SEEN : Flag.FLAGGED), true);
(v == mBatchReadButton ? Flag.SEEN : Flag.FLAGGED), newState);
}
}
else