Outbox emails stay marked as unread until sent

This commit is contained in:
str4d
2014-06-12 02:21:53 +00:00
parent 65fd5150ff
commit a3dc230855
2 changed files with 12 additions and 4 deletions

View File

@@ -321,6 +321,10 @@ public class EmailListFragment extends ListFragment implements
// Inflate the menu for the CAB
MenuInflater inflater = mode.getMenuInflater();
inflater.inflate(R.menu.email_list_context, menu);
if (BoteHelper.isOutbox(mFolder)) {
menu.findItem(R.id.action_mark_read).setVisible(false);
menu.findItem(R.id.action_mark_unread).setVisible(false);
}
// Only allow moving from the trash
// TODO change this when user folders are implemented
if (!BoteHelper.isTrash(mFolder))
@@ -342,8 +346,10 @@ public class EmailListFragment extends ListFragment implements
public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
// Here you can perform updates to the CAB due to
// an invalidate() request
menu.findItem(R.id.action_mark_read).setVisible(areUnread);
menu.findItem(R.id.action_mark_unread).setVisible(!areUnread);
if (!BoteHelper.isOutbox(mFolder)) {
menu.findItem(R.id.action_mark_read).setVisible(areUnread);
menu.findItem(R.id.action_mark_unread).setVisible(!areUnread);
}
return true;
}
}

View File

@@ -61,7 +61,8 @@ public class ViewEmailActivity extends ActionBarActivity implements
// Mark the visible email as not new
if (mMessageId != null) {
try {
mFolder.setNew(mMessageId, false);
if (!BoteHelper.isOutbox(mFolder))
mFolder.setNew(mMessageId, false);
mFolder.setRecent(mMessageId, false);
} catch (PasswordException e) {
// TODO Auto-generated catch block
@@ -189,7 +190,8 @@ public class ViewEmailActivity extends ActionBarActivity implements
// Mark the current email as not new
if (mMessageId != null) {
try {
mFolder.setNew(mMessageId, false);
if (!BoteHelper.isOutbox(mFolder))
mFolder.setNew(mMessageId, false);
mFolder.setRecent(mMessageId, false);
} catch (PasswordException e) {
// TODO Auto-generated catch block