1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-25 00:58:50 -05:00

Put back prev/next buttons to non-split message views for now.

Some people prefer them over swiping / volume keys.

They could probably be made optional so they can be hidden.

Also: delete the now unused message_view_fragment.xml and message_view_option.xml.
This commit is contained in:
m0viefreak 2013-02-04 17:21:42 +01:00
parent 7bcecf7060
commit 2c87efe5f3
4 changed files with 31 additions and 83 deletions

View File

@ -10,6 +10,22 @@
MessageList.configureMenu() if you make any changes to this file.
-->
<!-- MessageView -->
<item
android:id="@+id/next_message"
android:title="@string/next_action"
android:icon="?attr/iconActionNextMessage"
android:showAsAction="always"
/>
<!-- MessageView -->
<item
android:id="@+id/previous_message"
android:title="@string/previous_action"
android:icon="?attr/iconActionPreviousMessage"
android:showAsAction="always"
/>
<!-- MessageList -->
<item
android:id="@+id/search"

View File

@ -1,68 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/delete"
android:alphabeticShortcut="q"
android:title="@string/delete_action"
android:icon="?attr/iconActionDelete"
android:showAsAction="always"
/>
<item
android:id="@+id/single_message_options"
android:icon="?attr/iconActionSingleMessageOptions"
android:showAsAction="ifRoom"
android:title="@string/single_message_options_action">
<menu>
<item
android:id="@+id/reply"
android:title="@string/reply_action"/>
<item
android:id="@+id/reply_all"
android:title="@string/reply_all_action"/>
<item
android:id="@+id/forward"
android:title="@string/forward_action"/>
<item
android:id="@+id/share"
android:title="@string/send_alternate_action" />
</menu>
</item>
<item
android:id="@+id/archive"
android:title="@string/archive_action"
android:icon="?attr/iconActionArchive"
android:showAsAction="ifRoom"
/>
<item
android:id="@+id/spam"
android:title="@string/spam_action"
android:icon="?attr/iconActionSpam"
android:showAsAction="ifRoom"
/>
<item
android:id="@+id/move"
android:showAsAction="ifRoom"
android:icon="?attr/iconActionMoveOrCopy"
android:title="@string/move_action"
/>
<item
android:id="@+id/copy"
android:title="@string/copy_action"
/>
<item
android:id="@+id/toggle_unread"
android:alphabeticShortcut="u"
android:title="@string/mark_as_unread_action"
android:showAsAction="never"
/>
<item
android:id="@+id/select_text"
android:title="@string/select_text_action"
android:showAsAction="never"
/>
<item
android:id="@+id/toggle_message_view_theme"
android:title="@string/message_view_theme_action_dark"
android:showAsAction="never"
/>
</menu>

View File

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/next_message"
android:title="@string/next_action"
android:icon="?attr/iconActionNextMessage"
android:showAsAction="always"
/>
<item
android:id="@+id/previous_message"
android:title="@string/previous_action"
android:icon="?attr/iconActionPreviousMessage"
android:showAsAction="always"
/>
</menu>

View File

@ -777,6 +777,14 @@ public class MessageList extends K9FragmentActivity implements MessageListFragme
return true;
}
// MessageView
case R.id.next_message: {
showNextMessage();
return true;
}
case R.id.previous_message: {
showPreviousMessage();
return true;
}
case R.id.delete: {
mMessageViewFragment.onDelete();
return true;
@ -897,6 +905,8 @@ public class MessageList extends K9FragmentActivity implements MessageListFragme
*/
if (mMessageViewFragment == null || !mMessageViewFragment.isInitialized()) {
menu.findItem(R.id.next_message).setVisible(false);
menu.findItem(R.id.previous_message).setVisible(false);
menu.findItem(R.id.delete).setVisible(false);
menu.findItem(R.id.single_message_options).setVisible(false);
menu.findItem(R.id.archive).setVisible(false);
@ -907,6 +917,11 @@ public class MessageList extends K9FragmentActivity implements MessageListFragme
menu.findItem(R.id.select_text).setVisible(false);
menu.findItem(R.id.toggle_message_view_theme).setVisible(false);
} else {
// hide prev/next buttons in split mode
if (mDisplayMode != DisplayMode.MESSAGE_VIEW) {
menu.findItem(R.id.next_message).setVisible(false);
menu.findItem(R.id.previous_message).setVisible(false);
}
// Set title of menu item to switch to dark/light theme
MenuItem toggleTheme = menu.findItem(R.id.toggle_message_view_theme);
if (K9.getK9MessageViewTheme() == K9.THEME_DARK) {