1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-27 11:42:16 -05:00

Don't reuse IDs

This commit is contained in:
cketti 2014-04-07 19:17:50 +02:00
parent c53973910f
commit ab72aa0dd7
2 changed files with 17 additions and 15 deletions

View File

@ -111,22 +111,22 @@
android:title="@string/refile_action"> android:title="@string/refile_action">
<menu> <menu>
<item <item
android:id="@+id/archive" android:id="@+id/refile_archive"
android:title="@string/archive_action"/> android:title="@string/archive_action"/>
<!-- MessageView --> <!-- MessageView -->
<item <item
android:id="@+id/spam" android:id="@+id/refile_spam"
android:title="@string/spam_action"/> android:title="@string/spam_action"/>
<!-- MessageView --> <!-- MessageView -->
<item <item
android:id="@+id/move" android:id="@+id/refile_move"
android:title="@string/move_action"/> android:title="@string/move_action"/>
<!-- MessageView --> <!-- MessageView -->
<item <item
android:id="@+id/copy" android:id="@+id/refile_copy"
android:title="@string/copy_action"/> android:title="@string/copy_action"/>
</menu> </menu>
</item> </item>

View File

@ -867,19 +867,23 @@ public class MessageList extends K9FragmentActivity implements MessageListFragme
mMessageViewFragment.onToggleRead(); mMessageViewFragment.onToggleRead();
return true; return true;
} }
case R.id.archive: { case R.id.archive:
case R.id.refile_archive: {
mMessageViewFragment.onArchive(); mMessageViewFragment.onArchive();
return true; return true;
} }
case R.id.spam: { case R.id.spam:
case R.id.refile_spam: {
mMessageViewFragment.onSpam(); mMessageViewFragment.onSpam();
return true; return true;
} }
case R.id.move: { case R.id.move:
case R.id.refile_move: {
mMessageViewFragment.onMove(); mMessageViewFragment.onMove();
return true; return true;
} }
case R.id.copy: { case R.id.copy:
case R.id.refile_copy: {
mMessageViewFragment.onCopy(); mMessageViewFragment.onCopy();
return true; return true;
} }
@ -1035,14 +1039,12 @@ public class MessageList extends K9FragmentActivity implements MessageListFragme
/* /*
* Set visibility of copy, move, archive, spam in action bar and refile submenu * Set visibility of copy, move, archive, spam in action bar and refile submenu
*/ */
Menu refileSubmenu = menu.findItem(R.id.refile).getSubMenu();
if (mMessageViewFragment.isCopyCapable()) { if (mMessageViewFragment.isCopyCapable()) {
menu.findItem(R.id.copy).setVisible(K9.isMessageViewCopyActionVisible()); menu.findItem(R.id.copy).setVisible(K9.isMessageViewCopyActionVisible());
refileSubmenu.findItem(R.id.copy).setVisible(true); menu.findItem(R.id.refile_copy).setVisible(true);
} else { } else {
menu.findItem(R.id.copy).setVisible(false); menu.findItem(R.id.copy).setVisible(false);
refileSubmenu.findItem(R.id.copy).setVisible(false); menu.findItem(R.id.refile_copy).setVisible(false);
} }
if (mMessageViewFragment.isMoveCapable()) { if (mMessageViewFragment.isMoveCapable()) {
@ -1055,9 +1057,9 @@ public class MessageList extends K9FragmentActivity implements MessageListFragme
menu.findItem(R.id.spam).setVisible(canMessageBeMovedToSpam && menu.findItem(R.id.spam).setVisible(canMessageBeMovedToSpam &&
K9.isMessageViewSpamActionVisible()); K9.isMessageViewSpamActionVisible());
refileSubmenu.findItem(R.id.move).setVisible(true); menu.findItem(R.id.refile_move).setVisible(true);
refileSubmenu.findItem(R.id.archive).setVisible(canMessageBeArchived); menu.findItem(R.id.refile_archive).setVisible(canMessageBeArchived);
refileSubmenu.findItem(R.id.spam).setVisible(canMessageBeMovedToSpam); menu.findItem(R.id.refile_spam).setVisible(canMessageBeMovedToSpam);
} else { } else {
menu.findItem(R.id.move).setVisible(false); menu.findItem(R.id.move).setVisible(false);
menu.findItem(R.id.archive).setVisible(false); menu.findItem(R.id.archive).setVisible(false);