1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-24 02:12:15 -05:00

Display concrete action instead of "Toggle (un)read" & "(Un)star"

This commit is contained in:
cketti 2012-09-18 03:33:37 +02:00
parent f22801e9d6
commit 7bb11c09b2
5 changed files with 42 additions and 17 deletions

View File

@ -17,8 +17,12 @@
android:title="@string/delete_action"
/>
<item
android:id="@+id/read_toggle"
android:title="@string/read_toggle_action"
android:id="@+id/mark_as_read"
android:title="@string/mark_as_read_action"
/>
<item
android:id="@+id/mark_as_unread"
android:title="@string/mark_as_unread_action"
/>
<item
android:id="@+id/archive"
@ -32,15 +36,19 @@
android:id="@+id/copy"
android:title="@string/copy_action"
/>
<item
android:id="@+id/flag_toggle"
android:title="@string/flag_toggle_action"
<item
android:id="@+id/flag"
android:title="@string/flag_action"
/>
<item
<item
android:id="@+id/unflag"
android:title="@string/unflag_action"
/>
<item
android:id="@+id/spam"
android:title="@string/spam_action"
/>
<item
android:id="@+id/same_sender"
android:title="@string/from_same_sender" />
android:id="@+id/same_sender"
android:title="@string/from_same_sender" />
</menu>

View File

@ -64,7 +64,7 @@
<item
android:id="@+id/toggle_unread"
android:alphabeticShortcut="u"
android:title="@string/read_toggle_action"
android:title="@string/mark_as_unread_action"
android:showAsAction="never"
/>
<item

View File

@ -148,7 +148,6 @@ http://k9mail.googlecode.com/
<string name="accounts_action">Tilit</string>
<string name="mark_as_read_action">Merkitse luetuksi</string>
<string name="read_toggle_action">Vaihda lukemattomaksi/luetuksi</string>
<string name="send_alternate_action">Jaa</string>
<string name="send_alternate_chooser_title">Valitse lähettäjä</string>
@ -157,7 +156,6 @@ http://k9mail.googlecode.com/
    viestit, jotka ovat kansioissa, joita ei näytetä K-9:ssä)</string>
<string name="flag_action">Lisää tähti</string>
<string name="flag_toggle_action">Poista/lisää tähti</string>
<string name="unflag_action">Poista tähti</string>
<string name="copy_action">Kopio</string>
<string name="show_full_header_action">Näytä täydet otsikkotiedot</string>

View File

@ -148,7 +148,6 @@ http://k9mail.googlecode.com/
<string name="accounts_action">Accounts</string>
<string name="mark_as_read_action">Mark as read</string>
<string name="read_toggle_action">Toggle (un)read</string>
<string name="send_alternate_action">Share</string>
<string name="send_alternate_chooser_title">Choose sender</string>
@ -157,7 +156,6 @@ http://k9mail.googlecode.com/
messages in the folder that are not displayed in K-9)</string>
<string name="flag_action">Add star</string>
<string name="flag_toggle_action">(Un)star</string>
<string name="unflag_action">Remove star</string>
<string name="copy_action">Copy</string>
<string name="show_full_header_action">Show full header</string>

View File

@ -1984,6 +1984,19 @@ public class MessageList extends K9ListActivity implements OnItemClickListener {
final MessageInfoHolder message = (MessageInfoHolder) getItem((Integer)v.getTag());
final MenuBuilder menu = new MenuBuilder(MessageList.this);
getSupportMenuInflater().inflate(R.menu.message_list_item_context, menu);
if (message.read) {
menu.findItem(R.id.mark_as_read).setVisible(false);
} else {
menu.findItem(R.id.mark_as_unread).setVisible(false);
}
if (message.flagged) {
menu.findItem(R.id.flag).setVisible(false);
} else {
menu.findItem(R.id.unflag).setVisible(false);
}
MenuPopup popup = new MenuPopup(MessageList.this, menu, v);
popup.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
@ -2016,12 +2029,20 @@ public class MessageList extends K9ListActivity implements OnItemClickListener {
onDelete(selection);
break;
}
case R.id.read_toggle: {
onToggleRead(selection);
case R.id.mark_as_read: {
setFlag(selection, Flag.SEEN, true);
break;
}
case R.id.flag_toggle: {
onToggleFlag(selection);
case R.id.mark_as_unread: {
setFlag(selection, Flag.SEEN, false);
break;
}
case R.id.flag: {
setFlag(selection, Flag.FLAGGED, true);
break;
}
case R.id.unflag: {
setFlag(selection, Flag.FLAGGED, false);
break;
}