merged archive-move-spam-buttons into trunk

This commit is contained in:
Thialfihar 2010-07-05 13:41:52 +00:00
parent 5478ded371
commit 8752347b5f
13 changed files with 995 additions and 418 deletions

View file

@ -22,60 +22,116 @@
<include layout="@layout/message_view_header" />
<View
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1" />
<LinearLayout
android:id="@+id/scrolling_buttons"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="57dip"
android:background="@drawable/ic_email_thread_open_bottom_default"
android:gravity="center_vertical">
<Button
android:id="@+id/previous_scrolling"
android:text="@string/message_view_prev_action"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1" />
<LinearLayout
android:id="@+id/scrolling_move_buttons"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical">
<Button
android:id="@+id/archive_scrolling"
android:text="@string/message_view_archive_action"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="1" />
<Button
android:id="@+id/move_scrolling"
android:text="@string/message_view_move_action"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="1" />
<Button
android:id="@+id/spam_scrolling"
android:text="@string/message_view_spam_action"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:id="@+id/scrolling_buttons"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="57dip"
android:background="@android:color/transparent"
android:gravity="center_vertical">
<Button
android:id="@+id/previous_scrolling"
android:text="@string/message_view_prev_action"
android:textSize="35dip"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:padding="0dip"
android:layout_weight="1" />
<Button
android:id="@+id/reply_scrolling"
android:text="@string/reply_action"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="1" />
<Button
android:id="@+id/delete_scrolling"
android:text="@string/delete_action"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="1" />
<Button
android:id="@+id/forward_scrolling"
android:text="@string/forward_action"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="1" />
<Button
android:id="@+id/next_scrolling"
android:text="@string/message_view_next_action"
android:layout_weight="1" />
<Button
android:id="@+id/reply_scrolling"
android:text="@string/reply_action"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="1" />
<Button
android:id="@+id/delete_scrolling"
android:text="@string/delete_action"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="1" />
<Button
android:id="@+id/forward_scrolling"
android:text="@string/forward_action"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="1" />
<Button
android:id="@+id/next_scrolling"
android:text="@string/message_view_next_action"
android:textSize="35dip"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:padding="0dip"
android:layout_weight="1" />
</LinearLayout>
android:layout_weight="1" />
</LinearLayout>
</LinearLayout>
</ScrollView>
<LinearLayout
android:id="@+id/bottom_buttons"
android:id="@+id/move_buttons"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingRight="6dip"
android:background="@android:color/transparent"
android:gravity="center_vertical">
<Button
android:id="@+id/archive"
android:text="@string/message_view_archive_action"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="1" />
<Button
android:id="@+id/move"
android:text="@string/message_view_move_action"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="1" />
<Button
android:id="@+id/spam"
android:text="@string/message_view_spam_action"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:id="@+id/bottom_buttons"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="57dip"
android:background="@drawable/ic_email_thread_open_bottom_default"
android:background="@android:color/transparent"
android:gravity="center_vertical">
<Button
android:id="@+id/previous"

View file

@ -22,68 +22,124 @@
android:layout_weight="1">
<include layout="@layout/message_view_header" />
<View
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1" />
<LinearLayout
android:id="@+id/extra_buttons"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical">
<Button
android:id="@+id/reply"
android:text="@string/reply_action"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="1" />
<Button
android:id="@+id/reply_all"
android:text="@string/reply_all_action"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="1" />
<Button
android:id="@+id/forward"
android:text="@string/forward_action"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:id="@+id/scrolling_buttons"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical">
<Button
android:id="@+id/previous_scrolling"
android:text="@string/message_view_prev_action"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1" />
<LinearLayout
android:id="@+id/extra_buttons"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical">
<Button
android:id="@+id/reply"
android:text="@string/reply_action"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="1" />
<Button
android:id="@+id/reply_all"
android:text="@string/reply_all_action"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="1" />
<Button
android:id="@+id/forward"
android:text="@string/forward_action"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:id="@+id/scrolling_move_buttons"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical">
<Button
android:id="@+id/archive_scrolling"
android:text="@string/message_view_archive_action"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="1" />
<Button
android:id="@+id/move_scrolling"
android:text="@string/message_view_move_action"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="1" />
<Button
android:id="@+id/spam_scrolling"
android:text="@string/message_view_spam_action"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:id="@+id/scrolling_buttons"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical">
<Button
android:id="@+id/previous_scrolling"
android:text="@string/message_view_prev_action"
android:textSize="35dip"
android:padding="0dip"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="1" />
<ImageButton
android:id="@+id/delete_scrolling"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="1" />
<ImageButton
android:id="@+id/delete_scrolling"
android:layout_height="wrap_content"
android:src="@drawable/ic_button_delete"
android:layout_width="0dip"
android:layout_weight="1" />
<Button
android:id="@+id/next_scrolling"
android:layout_weight="1" />
<Button
android:id="@+id/next_scrolling"
android:padding="0dip"
android:text="@string/message_view_next_action"
android:text="@string/message_view_next_action"
android:textSize="35dip"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="1" />
</LinearLayout>
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="1" />
</LinearLayout>
</LinearLayout>
</ScrollView>
<LinearLayout
android:id="@+id/bottom_buttons"
android:id="@+id/move_buttons"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingRight="6dip"
android:background="@android:color/transparent"
android:gravity="center_vertical">
<Button
android:id="@+id/archive"
android:text="@string/message_view_archive_action"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="1" />
<Button
android:id="@+id/move"
android:text="@string/message_view_move_action"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="1" />
<Button
android:id="@+id/spam"
android:text="@string/message_view_spam_action"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:id="@+id/bottom_buttons"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
@ -98,7 +154,7 @@
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="1" />
<ImageButton
android:id="@+id/delete"
android:layout_height="wrap_content"
@ -113,6 +169,6 @@
android:padding="0dip"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="1" />
android:layout_weight="1" />
</LinearLayout>
</LinearLayout>

View file

@ -10,45 +10,53 @@
/>
<item
android:id="@+id/deselect"
android:visible="false"
android:visible="false"
android:title="@string/deselect_action"
/>
<item
android:id="@+id/delete"
android:title="@string/delete_action"
/>
<item
android:id="@+id/forward"
android:title="@string/forward_action"
/>
<item
android:id="@+id/reply_all"
android:title="@string/reply_all_action"
/>
<item
android:id="@+id/reply"
android:title="@string/reply_action"
/>
<item
android:id="@+id/mark_as_read"
android:title="@string/mark_as_read_action"
/>
<item
android:id="@+id/flag"
android:title="@string/flag_action"
/>
<item
android:id="@+id/move"
android:title="@string/move_action"
/>
<item
android:id="@+id/copy"
android:title="@string/copy_action"
<item
android:id="@+id/delete"
android:title="@string/delete_action"
/>
<item
android:id="@+id/forward"
android:title="@string/forward_action"
/>
<item
android:id="@+id/reply_all"
android:title="@string/reply_all_action"
/>
<item
android:id="@+id/reply"
android:title="@string/reply_action"
/>
<item
android:id="@+id/mark_as_read"
android:title="@string/mark_as_read_action"
/>
<item
android:id="@+id/flag"
android:title="@string/flag_action"
/>
<item
android:id="@+id/archive"
android:title="@string/archive_action"
/>
<item
android:id="@+id/spam"
android:title="@string/spam_action"
/>
<item
android:id="@+id/move"
android:title="@string/move_action"
/>
<item
android:id="@+id/copy"
android:title="@string/copy_action"
/>
<item
android:id="@+id/send_alternate"
android:title="@string/send_alternate_action"
/>
<item
android:id="@+id/send_alternate"
android:title="@string/send_alternate_action"
/>
<item
android:id="@+id/same_sender"
android:title="@string/from_same_sender"

View file

@ -1,127 +1,135 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/compose"
android:id="@+id/compose"
android:alphabeticShortcut="c"
android:title="@string/compose_action"
android:icon="@drawable/ic_menu_compose"
/>
<item
android:id="@+id/set_sort"
android:title="@string/sort_by"
android:icon="@drawable/ic_menu_set_sort">
<menu>
<item
android:id="@+id/set_sort_date"
android:title="@string/sort_by_date"
/>
<item
android:id="@+id/set_sort_subject"
android:title="@string/sort_by_subject"
/>
<item
android:id="@+id/set_sort_sender"
android:title="@string/sort_by_sender"
/>
<item
android:id="@+id/set_sort_flag"
android:title="@string/sort_by_flag"
/>
<item
android:id="@+id/set_sort_unread"
android:title="@string/sort_by_unread"
/>
<item
android:id="@+id/set_sort_attach"
android:title="@string/sort_by_attach"
/>
</menu>
</item>
<item
android:title="@string/compose_action"
android:icon="@drawable/ic_menu_compose"
/>
<item
android:id="@+id/set_sort"
android:title="@string/sort_by"
android:icon="@drawable/ic_menu_set_sort">
<menu>
<item
android:id="@+id/set_sort_date"
android:title="@string/sort_by_date"
/>
<item
android:id="@+id/set_sort_subject"
android:title="@string/sort_by_subject"
/>
<item
android:id="@+id/set_sort_sender"
android:title="@string/sort_by_sender"
/>
<item
android:id="@+id/set_sort_flag"
android:title="@string/sort_by_flag"
/>
<item
android:id="@+id/set_sort_unread"
android:title="@string/sort_by_unread"
/>
<item
android:id="@+id/set_sort_attach"
android:title="@string/sort_by_attach"
/>
</menu>
</item>
<item
android:id="@+id/select_all"
android:title="@string/batch_select_all"
android:title="@string/batch_select_all"
android:icon="@drawable/ic_menu_select_all"/>
<item
android:id="@+id/batch_ops"
android:title="@string/batch_ops"
android:icon="@drawable/ic_menu_batch">
<menu>
<item
android:id="@+id/batch_flag_mode"
android:title="@string/batch_flag_mode"
android:visible="false"
/>
<item
android:id="@+id/batch_plain_mode"
android:title="@string/batch_plain_mode"
android:visible="false"
/>
<item
android:id="@+id/batch_delete_op"
android:title="@string/batch_delete_op"
/>
<item
android:id="@+id/batch_mark_read_op"
android:title="@string/batch_mark_read_op"
/>
<item
android:id="@+id/batch_flag_op"
android:title="@string/batch_flag_op"
/>
<item
android:id="@+id/batch_mark_unread_op"
android:title="@string/batch_mark_unread_op"
/>
<item
android:id="@+id/batch_unflag_op"
android:title="@string/batch_unflag_op"
/>
<item
android:id="@+id/batch_move_op"
android:title="@string/batch_move_op"
/>
<item
android:id="@+id/batch_copy_op"
android:title="@string/batch_copy_op"
/>
<item
android:id="@+id/batch_select_all"
android:title="@string/batch_select_all"
/>
<item
android:id="@+id/batch_deselect_all"
android:title="@string/batch_deselect_all"
/>
</menu>
</item>
<item
android:id="@+id/batch_ops"
android:title="@string/batch_ops"
android:icon="@drawable/ic_menu_batch">
<menu>
<item
android:id="@+id/batch_flag_mode"
android:title="@string/batch_flag_mode"
android:visible="false"
/>
<item
android:id="@+id/batch_plain_mode"
android:title="@string/batch_plain_mode"
android:visible="false"
/>
<item
android:id="@+id/batch_delete_op"
android:title="@string/batch_delete_op"
/>
<item
android:id="@+id/batch_mark_read_op"
android:title="@string/batch_mark_read_op"
/>
<item
android:id="@+id/batch_flag_op"
android:title="@string/batch_flag_op"
/>
<item
android:id="@+id/batch_mark_unread_op"
android:title="@string/batch_mark_unread_op"
/>
<item
android:id="@+id/batch_unflag_op"
android:title="@string/batch_unflag_op"
/>
<item
android:id="@+id/batch_archive_op"
android:title="@string/batch_archive_op"
/>
<item
android:id="@+id/batch_spam_op"
android:title="@string/batch_spam_op"
/>
<item
android:id="@+id/batch_move_op"
android:title="@string/batch_move_op"
/>
<item
android:id="@+id/batch_copy_op"
android:title="@string/batch_copy_op"
/>
<item
android:id="@+id/batch_select_all"
android:title="@string/batch_select_all"
/>
<item
android:id="@+id/batch_deselect_all"
android:title="@string/batch_deselect_all"
/>
</menu>
</item>
<item
android:id="@+id/list_folders"
android:alphabeticShortcut="f"
android:title="@string/list_folders_action"
android:icon="@drawable/ic_menu_navigate"
android:title="@string/list_folders_action"
android:icon="@drawable/ic_menu_navigate"
/>
<item
android:id="@+id/send_messages"
<item
android:id="@+id/send_messages"
android:alphabeticShortcut="r"
android:title="@string/send_messages_action"
android:icon="@drawable/ic_menu_refresh"
/>
<item
android:id="@+id/check_mail"
android:title="@string/send_messages_action"
android:icon="@drawable/ic_menu_refresh"
/>
<item
android:id="@+id/check_mail"
android:alphabeticShortcut="r"
android:title="@string/check_mail_action"
android:icon="@drawable/ic_menu_refresh"
/>
android:title="@string/check_mail_action"
android:icon="@drawable/ic_menu_refresh"
/>
<item
android:id="@+id/accounts"
android:title="@string/accounts_action"
android:icon="@drawable/ic_menu_account_list"
/>
<item
android:id="@+id/mark_all_as_read"
android:title="@string/mark_all_as_read_action"
android:icon="@drawable/ic_menu_inbox"
/>
android:id="@+id/mark_all_as_read"
android:title="@string/mark_all_as_read_action"
android:icon="@drawable/ic_menu_inbox"
/>
<item
android:id="@+id/settings"
android:title="@string/preferences_action"
@ -129,22 +137,22 @@
<menu>
<item
android:id="@+id/folder_settings"
android:title="@string/folder_settings_action"
android:icon="@drawable/ic_menu_preferences"
/>
<item
android:id="@+id/account_settings"
android:title="@string/account_settings_action"
android:icon="@android:drawable/ic_menu_preferences"
/>
android:id="@+id/folder_settings"
android:title="@string/folder_settings_action"
android:icon="@drawable/ic_menu_preferences"
/>
<item
android:id="@+id/account_settings"
android:title="@string/account_settings_action"
android:icon="@android:drawable/ic_menu_preferences"
/>
<item android:id="@+id/app_settings"
android:title="@string/preferences_action"
android:icon="@android:drawable/ic_menu_preferences"
/>
android:title="@string/preferences_action"
android:icon="@android:drawable/ic_menu_preferences"
/>
</menu>
</item>
<item
<item
android:id="@+id/expunge"
android:title="@string/expunge_action"
/>

View file

@ -31,9 +31,9 @@
android:icon="@drawable/ic_menu_delete"
/>
<item
android:id="@+id/show_full_header"
android:title="@string/show_full_header_action"
/>
android:id="@+id/show_full_header"
android:title="@string/show_full_header_action"
/>
<item
android:id="@+id/flag"
android:alphabeticShortcut="s"
@ -46,11 +46,19 @@
android:icon="@drawable/ic_menu_forward_mail"
/>
<item
android:id="@+id/move"
android:title="@string/move_action"
/>
<item
android:id="@+id/copy"
android:title="@string/copy_action"
/>
android:id="@+id/archive"
android:title="@string/archive_action"
/>
<item
android:id="@+id/spam"
android:title="@string/spam_action"
/>
<item
android:id="@+id/move"
android:title="@string/move_action"
/>
<item
android:id="@+id/copy"
android:title="@string/copy_action"
/>
</menu>

View file

@ -451,6 +451,10 @@ Willkommen zum \"K-9 Mail\"-Setup. K-9 ist eine quelloffene E-Mail-Anwendung fü
<string name="account_settings_hide_buttons_keyboard_avail">Nur wenn Tastatur aktiv</string>
<string name="account_settings_hide_buttons_always">Immer</string>
<string name="account_settings_enable_move_buttons_label">Verschiebungsbuttons</string>
<string name="account_settings_enable_move_buttons_summary">Zeige Sichern, Verschieben und Spam Buttons.</string>
<string name="account_settings_hide_move_buttons_label">Verschiebungs-Scrollbuttons</string>
<string name="account_settings_composition">Nachricht verfassen</string>
<string name="account_settings_sync">Ordner synchronisieren</string>
<string name="account_settings_folders">Ordner</string>
@ -667,6 +671,8 @@ Willkommen zum \"K-9 Mail\"-Setup. K-9 ist eine quelloffene E-Mail-Anwendung fü
<string name="batch_mark_unread_op">Ausgewählte als ungelesen markieren</string>
<string name="batch_flag_op">Ausgewählte als wichtig markieren</string>
<string name="batch_unflag_op">Markierung bei Ausgewählten entfernen</string>
<string name="batch_archive_op">Ausgewählte sichern</string>
<string name="batch_spam_op">Ausgewählte als Spam markieren</string>
<string name="batch_move_op">Ausgewählte verschieben</string>
<string name="batch_copy_op">Ausgewählte kopieren</string>
<string name="batch_flag_mode">Stern-Modus</string>

View file

@ -4,9 +4,9 @@
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -38,14 +38,14 @@
<item>10</item>
<item>15</item>
<item>30</item>
<item>60</item>
<item>120</item>
<item>180</item>
<item>360</item>
<item>720</item>
<item>1440</item>
<item>60</item>
<item>120</item>
<item>180</item>
<item>360</item>
<item>720</item>
<item>1440</item>
</string-array>
<string-array name="account_settings_display_count_entries">
<item>@string/account_setup_options_mail_display_count_10</item>
<item>@string/account_setup_options_mail_display_count_25</item>
@ -65,7 +65,7 @@
<item>500</item>
<item>1000</item>
</string-array>
<string-array name="account_settings_message_age_entries">
<item>@string/account_settings_message_age_any</item>
<item>@string/account_settings_message_age_0</item>
@ -95,7 +95,7 @@
<item>168</item>
<item>365</item>
</string-array>
<string-array name="account_settings_folder_display_mode_entries">
<item>@string/account_settings_folder_display_mode_all</item>
<item>@string/account_settings_folder_display_mode_first_class</item>
@ -107,9 +107,9 @@
<item>ALL</item>
<item>FIRST_CLASS</item>
<item>FIRST_AND_SECOND_CLASS</item>
<item>NOT_SECOND_CLASS</item>
<item>NOT_SECOND_CLASS</item>
</string-array>
<string-array name="account_settings_hide_buttons_entries">
<item>@string/account_settings_hide_buttons_never</item>
<item>@string/account_settings_hide_buttons_keyboard_avail</item>
@ -121,7 +121,19 @@
<item>KEYBOARD_AVAILABLE</item>
<item>ALWAYS</item>
</string-array>
<string-array name="account_settings_hide_move_buttons_entries">
<item>@string/account_settings_hide_buttons_never</item>
<item>@string/account_settings_hide_buttons_keyboard_avail</item>
<item>@string/account_settings_hide_buttons_always</item>
</string-array>
<string-array name="account_settings_hide_move_buttons_values">
<item>NEVER</item>
<item>KEYBOARD_AVAILABLE</item>
<item>ALWAYS</item>
</string-array>
<string-array name="account_settings_searchable_entries">
<item>@string/account_settings_searchable_all</item>
<item>@string/account_settings_searchable_displayable</item>
@ -133,7 +145,7 @@
<item>DISPLAYABLE</item>
<item>NONE</item>
</string-array>
<string-array name="account_settings_folder_sync_mode_entries">
<item>@string/account_settings_folder_sync_mode_all</item>
<item>@string/account_settings_folder_sync_mode_first_class</item>
@ -146,10 +158,10 @@
<item>ALL</item>
<item>FIRST_CLASS</item>
<item>FIRST_AND_SECOND_CLASS</item>
<item>NOT_SECOND_CLASS</item>
<item>NOT_SECOND_CLASS</item>
<item>NONE</item>
</string-array>
<string-array name="account_settings_folder_push_mode_entries">
<item>@string/account_settings_folder_push_mode_all</item>
<item>@string/account_settings_folder_push_mode_first_class</item>
@ -162,10 +174,10 @@
<item>ALL</item>
<item>FIRST_CLASS</item>
<item>FIRST_AND_SECOND_CLASS</item>
<item>NOT_SECOND_CLASS</item>
<item>NOT_SECOND_CLASS</item>
<item>NONE</item>
</string-array>
<string-array name="account_settings_push_limit_entries">
<item>@string/account_setup_push_limit_10</item>
<item>@string/account_setup_push_limit_25</item>
@ -175,7 +187,7 @@
<item>@string/account_setup_push_limit_500</item>
<item>@string/account_setup_push_limit_1000</item>
</string-array>
<string-array name="account_settings_push_limit_values">
<item>10</item>
<item>25</item>
@ -185,7 +197,7 @@
<item>500</item>
<item>1000</item>
</string-array>
<string-array name="account_settings_folder_target_mode_entries">
<item>@string/account_settings_folder_target_mode_all</item>
<item>@string/account_settings_folder_target_mode_first_class</item>
@ -197,9 +209,9 @@
<item>ALL</item>
<item>FIRST_CLASS</item>
<item>FIRST_AND_SECOND_CLASS</item>
<item>NOT_SECOND_CLASS</item>
<item>NOT_SECOND_CLASS</item>
</string-array>
<string-array name="folder_settings_folder_display_mode_entries">
<item>@string/folder_settings_folder_display_mode_normal</item>
<item>@string/folder_settings_folder_display_mode_first_class</item>
@ -209,85 +221,85 @@
<string-array name="folder_settings_folder_display_mode_values">
<item>NO_CLASS</item>
<item>FIRST_CLASS</item>
<item>SECOND_CLASS</item>
<item>SECOND_CLASS</item>
</string-array>
<string-array name="folder_settings_folder_sync_mode_entries">
<item>@string/folder_settings_folder_sync_mode_normal</item>
<item>@string/folder_settings_folder_sync_mode_first_class</item>
<item>@string/folder_settings_folder_sync_mode_second_class</item>
<item>@string/folder_settings_folder_sync_mode_inherited</item>
</string-array>
<string-array name="folder_settings_folder_sync_mode_values">
<item>NO_CLASS</item>
<item>FIRST_CLASS</item>
<item>SECOND_CLASS</item>
<item>INHERITED</item>
<item>SECOND_CLASS</item>
<item>INHERITED</item>
</string-array>
<string-array name="folder_settings_folder_push_mode_entries">
<item>@string/folder_settings_folder_push_mode_normal</item>
<item>@string/folder_settings_folder_push_mode_first_class</item>
<item>@string/folder_settings_folder_push_mode_second_class</item>
<item>@string/folder_settings_folder_push_mode_inherited</item>
</string-array>
<string-array name="folder_settings_folder_push_mode_values">
<item>NO_CLASS</item>
<item>FIRST_CLASS</item>
<item>SECOND_CLASS</item>
<item>INHERITED</item>
<item>SECOND_CLASS</item>
<item>INHERITED</item>
</string-array>
<string-array name="account_setup_delete_policy_entries">
<item>@string/account_setup_incoming_delete_policy_never_label</item>
<item>@string/account_setup_incoming_delete_policy_delete_label</item>
<item>@string/account_setup_incoming_delete_policy_markread_label</item>
<item>@string/account_setup_incoming_delete_policy_never_label</item>
<item>@string/account_setup_incoming_delete_policy_delete_label</item>
<item>@string/account_setup_incoming_delete_policy_markread_label</item>
</string-array>
<string-array name="account_setup_delete_policy_values">
<item>0</item>
<item>2</item>
<item>3</item>
<item>0</item>
<item>2</item>
<item>3</item>
</string-array>
<string-array name="account_setup_expunge_policy_entries">
<item>@string/account_setup_expunge_policy_immediately</item>
<item>@string/account_setup_expunge_policy_on_poll</item>
<item>@string/account_setup_expunge_policy_manual</item>
</string-array>
<string-array name="account_setup_expunge_policy_values">
<item>EXPUNGE_IMMEDIATELY</item>
<item>EXPUNGE_ON_POLL</item>
<item>EXPUNGE_MANUALLY</item>
</string-array>
<string-array name="settings_theme_entries">
<item>@string/setting_theme_light</item>
<item>@string/setting_theme_light</item>
<item>@string/setting_theme_dark</item>
</string-array>
<string-array name="settings_theme_values">
<item>light</item>
<item>dark</item>
</string-array>
<string-array name="background_ops_entries">
<item>@string/background_ops_enabled</item>
<item>@string/background_ops_auto_sync</item>
<item>@string/background_ops_always</item>
<item>@string/background_ops_enabled</item>
<item>@string/background_ops_auto_sync</item>
<item>@string/background_ops_always</item>
<item>@string/background_ops_never</item>
</string-array>
<string-array name="background_ops_values">
<item>WHEN_CHECKED</item>
<item>WHEN_CHECKED_AUTO_SYNC</item>
<item>ALWAYS</item>
<item>NEVER</item>
<item>NEVER</item>
</string-array>
<string-array name="date_formats">
<item>@string/date_format_short</item>
<item>@string/date_format_medium</item>
@ -297,45 +309,45 @@
<string-array name="font_entries">
<item>@string/font_size_tiniest</item>
<item>@string/font_size_tiny</item>
<item>@string/font_size_smaller</item>
<item>@string/font_size_small</item>
<item>@string/font_size_medium</item>
<item>@string/font_size_large</item>
<item>@string/font_size_larger</item>
<item>@string/font_size_tiniest</item>
<item>@string/font_size_tiny</item>
<item>@string/font_size_smaller</item>
<item>@string/font_size_small</item>
<item>@string/font_size_medium</item>
<item>@string/font_size_large</item>
<item>@string/font_size_larger</item>
</string-array>
<string-array name="font_values">
<item>10</item>
<item>12</item>
<item>14</item>
<item>16</item>
<item>18</item>
<item>20</item>
<item>22</item>
<item>10</item>
<item>12</item>
<item>14</item>
<item>16</item>
<item>18</item>
<item>20</item>
<item>22</item>
</string-array>
<string-array name="font_entries_webview">
<item>@string/font_size_webview_smaller</item>
<item>@string/font_size_webview_small</item>
<item>@string/font_size_webview_normal</item>
<item>@string/font_size_webview_large</item>
<item>@string/font_size_webview_larger</item>
<item>@string/font_size_webview_smaller</item>
<item>@string/font_size_webview_small</item>
<item>@string/font_size_webview_normal</item>
<item>@string/font_size_webview_large</item>
<item>@string/font_size_webview_larger</item>
</string-array>
<!--
Be sure to also change FontSizes.getMessageViewContentAsInt() and
FontSizes.setMessageViewContent() if you change this.
-->
<!--
Be sure to also change FontSizes.getMessageViewContentAsInt() and
FontSizes.setMessageViewContent() if you change this.
-->
<string-array name="font_values_webview">
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
</string-array>
<string-array name="idle_refresh_period_entries">
<item>@string/idle_refresh_period_1min</item>
<item>@string/idle_refresh_period_2min</item>
@ -355,9 +367,9 @@
<item>6</item>
<item>12</item>
<item>24</item>
<item>36</item>
<item>48</item>
<item>60</item>
<item>36</item>
<item>48</item>
<item>60</item>
</string-array>
<string-array name="account_settings_vibrate_pattern_entries">

View file

@ -45,6 +45,7 @@
<string name="reply_all_action">Reply all</string>
<string name="delete_action">Delete</string>
<string name="archive_action">Archive</string>
<string name="spam_action">Spam</string>
<string name="delete_all_action">Clear folder</string>
<string name="forward_action">Forward</string>
<string name="move_action">Move</string>
@ -259,6 +260,9 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin
<string name="message_view_attachment_download_action">Save</string>
<string name="message_view_prev_action">\u25BC</string>
<string name="message_view_next_action">\u25B2</string>
<string name="message_view_archive_action">Archive</string>
<string name="message_view_move_action">Move</string>
<string name="message_view_spam_action">Spam</string>
<string name="message_view_datetime_fmt">MMM dd yyyy hh:mm a</string>
<string name="message_view_status_attachment_saved">Attachment saved to SD card as <xliff:g id="filename">%s</xliff:g>.</string>
<string name="message_view_status_attachment_not_saved">Unable to save attachment to SD card.</string>
@ -491,6 +495,10 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin
<string name="account_settings_hide_buttons_keyboard_avail">When keyboard is available</string>
<string name="account_settings_hide_buttons_always">Always</string>
<string name="account_settings_enable_move_buttons_label">Enable move buttons</string>
<string name="account_settings_enable_move_buttons_summary">Show the Archive, Move, and Spam button.</string>
<string name="account_settings_hide_move_buttons_label">Scroll move buttons</string>
<string name="account_settings_composition">Writing messages</string>
<string name="account_settings_sync">Syncing folders</string>
<string name="account_settings_folders">Folders</string>
@ -748,6 +756,8 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin
<string name="batch_mark_unread_op">Mark selected unread</string>
<string name="batch_flag_op">Add star to selected</string>
<string name="batch_unflag_op">Remove star from selected</string>
<string name="batch_archive_op">Move selected to Archive</string>
<string name="batch_spam_op">Move selected to Spam</string>
<string name="batch_move_op">Move selected</string>
<string name="batch_copy_op">Copy selected</string>
<string name="batch_flag_mode">Star mode</string>

View file

@ -30,17 +30,17 @@
android:key="account_default"
android:title="@string/account_settings_default_label"
android:summary="@string/account_settings_default_summary" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/account_settings_message_lists">
</PreferenceCategory>
<PreferenceCategory android:title="@string/account_settings_message_lists">
<ListPreference
android:key="account_display_count"
android:title="@string/account_settings_mail_display_count_label"
android:entries="@array/account_settings_display_count_entries"
android:entryValues="@array/account_settings_display_count_values"
android:dialogTitle="@string/account_settings_mail_display_count_label" />
android:dialogTitle="@string/account_settings_mail_display_count_label" />
<Preference
android:key="chip_color"
android:singleLine="true"
@ -64,6 +64,20 @@
android:entryValues="@array/account_settings_hide_buttons_values"
android:dialogTitle="@string/account_settings_hide_buttons_label" />
<CheckBoxPreference
android:key="enable_move_buttons"
android:title="@string/account_settings_enable_move_buttons_label"
android:defaultValue="true"
android:summary="@string/account_settings_enable_move_buttons_summary" />
<ListPreference
android:key="hide_move_buttons_enum"
android:dependency="enable_move_buttons"
android:title="@string/account_settings_hide_move_buttons_label"
android:entries="@array/account_settings_hide_move_buttons_entries"
android:entryValues="@array/account_settings_hide_move_buttons_values"
android:dialogTitle="@string/account_settings_hide_move_buttons_label" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/account_settings_sync">
@ -80,35 +94,35 @@
android:entries="@array/account_settings_message_age_entries"
android:entryValues="@array/account_settings_message_age_values"
android:dialogTitle="@string/account_settings_message_age_label" />
<ListPreference
android:key="folder_sync_mode"
android:title="@string/account_settings_folder_sync_mode_label"
android:entries="@array/account_settings_folder_sync_mode_entries"
android:entryValues="@array/account_settings_folder_sync_mode_values"
android:dialogTitle="@string/account_settings_folder_sync_mode_label" />
<ListPreference
android:dialogTitle="@string/account_settings_folder_sync_mode_label" />
<ListPreference
android:key="folder_push_mode"
android:title="@string/account_settings_folder_push_mode_label"
android:entries="@array/account_settings_folder_push_mode_entries"
android:entryValues="@array/account_settings_folder_push_mode_values"
android:dialogTitle="@string/account_settings_folder_push_mode_label" />
android:dialogTitle="@string/account_settings_folder_push_mode_label" />
<ListPreference
android:key="delete_policy"
android:title="@string/account_setup_incoming_delete_policy_label"
android:entries="@array/account_setup_delete_policy_entries"
android:entryValues="@array/account_setup_delete_policy_values"
android:dialogTitle="@string/account_setup_incoming_delete_policy_label" />
android:key="delete_policy"
android:title="@string/account_setup_incoming_delete_policy_label"
android:entries="@array/account_setup_delete_policy_entries"
android:entryValues="@array/account_setup_delete_policy_values"
android:dialogTitle="@string/account_setup_incoming_delete_policy_label" />
<ListPreference
android:key="expunge_policy"
android:title="@string/account_setup_expunge_policy_label"
android:entries="@array/account_setup_expunge_policy_entries"
android:entryValues="@array/account_setup_expunge_policy_values"
android:dialogTitle="@string/account_setup_expunge_policy_label" />
<CheckBoxPreference
android:key="account_sync_remote_deletetions"
android:title="@string/account_settings_sync_remote_deletetions_label"
@ -117,15 +131,15 @@
<PreferenceScreen
android:key="incoming"
android:title="@string/account_settings_incoming_label"
android:summary="@string/account_settings_incoming_summary"
/>
android:title="@string/account_settings_incoming_label"
android:summary="@string/account_settings_incoming_summary"
/>
</PreferenceCategory>
<PreferenceCategory android:title="@string/account_settings_folders">
<Preference
<PreferenceCategory android:title="@string/account_settings_folders">
<Preference
android:key="account_setup_auto_expand_folder"
android:singleLine="true"
android:title="@string/account_setup_auto_expand_folder"
@ -137,45 +151,45 @@
android:entries="@array/account_settings_folder_display_mode_entries"
android:entryValues="@array/account_settings_folder_display_mode_values"
android:dialogTitle="@string/account_settings_folder_display_mode_label" />
<ListPreference
android:key="folder_target_mode"
android:title="@string/account_settings_folder_target_mode_label"
android:entries="@array/account_settings_folder_target_mode_entries"
android:entryValues="@array/account_settings_folder_target_mode_values"
android:dialogTitle="@string/account_settings_folder_target_mode_label" />
<ListPreference
android:key="searchable_folders"
android:title="@string/account_settings_searchable_label"
android:entries="@array/account_settings_searchable_entries"
android:entryValues="@array/account_settings_searchable_values"
android:dialogTitle="@string/account_settings_searchable_label" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/account_settings_composition">
<PreferenceScreen
android:key="composition"
android:summary="@string/account_settings_composition_summary"
android:title="@string/account_settings_composition_label"
android:summary="@string/account_settings_composition_summary"
android:title="@string/account_settings_composition_label"
/>
/>
<PreferenceScreen
android:key="manage_identities"
android:title="@string/account_settings_identities_label"
android:summary="@string/account_settings_identities_summary"
/>
android:title="@string/account_settings_identities_label"
android:summary="@string/account_settings_identities_summary"
/>
<PreferenceScreen
android:key="outgoing"
android:title="@string/account_settings_outgoing_label"
android:summary="@string/account_settings_outgoing_summary"
/>
android:title="@string/account_settings_outgoing_label"
android:summary="@string/account_settings_outgoing_summary"
/>
<EditTextPreference
android:key="account_quote_prefix"
@ -193,14 +207,14 @@
android:title="@string/account_settings_notify_label"
android:defaultValue="true"
android:summary="@string/account_settings_notify_summary" />
<CheckBoxPreference
android:key="account_notify_self"
android:dependency="account_notify"
android:title="@string/account_settings_notify_self_label"
android:defaultValue="true"
android:summary="@string/account_settings_notify_self_summary" />
<RingtonePreference
android:layout="?android:attr/preferenceLayoutChild"
android:dependency="account_notify"

View file

@ -90,6 +90,8 @@ public class Account implements BaseAccount
private String mRingtoneUri;
private boolean mNotifySync;
private HideButtons mHideMessageViewButtons;
private HideButtons mHideMessageViewMoveButtons;
private boolean mEnableMoveButtons;
private boolean mIsSignatureBeforeQuotedText;
private String mExpungePolicy = EXPUNGE_IMMEDIATELY;
private int mMaxPushFolders;
@ -153,6 +155,8 @@ public class Account implements BaseAccount
mFolderPushMode = FolderMode.FIRST_CLASS;
mFolderTargetMode = FolderMode.NOT_SECOND_CLASS;
mHideMessageViewButtons = HideButtons.NEVER;
mHideMessageViewMoveButtons = HideButtons.NEVER;
mEnableMoveButtons = false;
mRingtoneUri = "content://settings/system/notification_sound";
mIsSignatureBeforeQuotedText = false;
mExpungePolicy = EXPUNGE_IMMEDIATELY;
@ -279,6 +283,18 @@ public class Account implements BaseAccount
mHideMessageViewButtons = HideButtons.NEVER;
}
try
{
mHideMessageViewMoveButtons = HideButtons.valueOf(preferences.getPreferences().getString(mUuid + ".hideMoveButtonsEnum",
HideButtons.NEVER.name()));
}
catch (Exception e)
{
mHideMessageViewMoveButtons = HideButtons.NEVER;
}
mEnableMoveButtons = preferences.getPreferences().getBoolean(mUuid + ".enableMoveButtons", false);
mRingtoneUri = preferences.getPreferences().getString(mUuid + ".ringtone",
"content://settings/system/notification_sound");
try
@ -475,6 +491,8 @@ public class Account implements BaseAccount
editor.putInt(mUuid + ".vibrateTimes", mVibrateTimes);
editor.putBoolean(mUuid + ".ring", mRing);
editor.putString(mUuid + ".hideButtonsEnum", mHideMessageViewButtons.name());
editor.putString(mUuid + ".hideMoveButtonsEnum", mHideMessageViewMoveButtons.name());
editor.putBoolean(mUuid + ".enableMoveButtons", mEnableMoveButtons);
editor.putString(mUuid + ".ringtone", mRingtoneUri);
editor.putString(mUuid + ".folderDisplayMode", mFolderDisplayMode.name());
editor.putString(mUuid + ".folderSyncMode", mFolderSyncMode.name());
@ -963,6 +981,16 @@ public class Account implements BaseAccount
mHideMessageViewButtons = hideMessageViewButtons;
}
public synchronized HideButtons getHideMessageViewMoveButtons()
{
return mHideMessageViewMoveButtons;
}
public synchronized void setHideMessageViewMoveButtons(HideButtons hideMessageViewButtons)
{
mHideMessageViewMoveButtons = hideMessageViewButtons;
}
public synchronized FolderMode getFolderTargetMode()
{
return mFolderTargetMode;
@ -1354,6 +1382,16 @@ public class Account implements BaseAccount
mQuotePrefix = quotePrefix;
}
public boolean getEnableMoveButtons()
{
return mEnableMoveButtons;
}
public void setEnableMoveButtons(boolean enableMoveButtons)
{
mEnableMoveButtons = enableMoveButtons;
}
public synchronized boolean syncRemoteDeletions()
{
return mSyncRemoteDeletions;

View file

@ -23,6 +23,7 @@ import android.widget.*;
import android.widget.AdapterView.AdapterContextMenuInfo;
import android.widget.CompoundButton.OnCheckedChangeListener;
import com.fsck.k9.*;
import com.fsck.k9.activity.setup.AccountSetupIncoming;
import com.fsck.k9.activity.setup.Prefs;
import com.fsck.k9.activity.setup.AccountSettings;
import com.fsck.k9.activity.setup.FolderSettings;
@ -58,9 +59,7 @@ public class MessageList
private static final int DIALOG_MARK_ALL_AS_READ = 1;
private static final int ACTIVITY_CHOOSE_FOLDER_MOVE = 1;
private static final int ACTIVITY_CHOOSE_FOLDER_COPY = 2;
private static final int ACTIVITY_CHOOSE_FOLDER_MOVE_BATCH = 3;
private static final int ACTIVITY_CHOOSE_FOLDER_COPY_BATCH = 4;
@ -542,10 +541,8 @@ public class MessageList
mListView.setScrollingCacheEnabled(true);
mListView.setOnItemClickListener(this);
registerForContextMenu(mListView);
mBatchButtonArea = findViewById(R.id.batch_button_area);
mBatchReadButton = (ImageButton) findViewById(R.id.batch_read_button);
mBatchReadButton.setOnClickListener(this);
@ -932,6 +929,40 @@ public class MessageList
startActivityForResult(intent, ACTIVITY_CHOOSE_FOLDER_MOVE);
}
private void onArchive(MessageInfoHolder holder)
{
if (mController.isMoveCapable(holder.message.getFolder().getAccount()) == false)
{
return;
}
if (mController.isMoveCapable(holder.message) == false)
{
Toast toast = Toast.makeText(this, R.string.move_copy_cannot_copy_unsynced_message, Toast.LENGTH_LONG);
toast.show();
return;
}
onMoveChosen(holder, holder.message.getFolder().getAccount().getArchiveFolderName());
}
private void onSpam(MessageInfoHolder holder)
{
if (mController.isMoveCapable(holder.message.getFolder().getAccount()) == false)
{
return;
}
if (mController.isMoveCapable(holder.message) == false)
{
Toast toast = Toast.makeText(this, R.string.move_copy_cannot_copy_unsynced_message, Toast.LENGTH_LONG);
toast.show();
return;
}
onMoveChosen(holder, holder.message.getFolder().getAccount().getSpamFolderName());
}
private void onCopy(MessageInfoHolder holder)
{
if (mController.isCopyCapable(holder.message.getFolder().getAccount()) == false)
@ -1021,6 +1052,9 @@ public class MessageList
{
if (mController.isMoveCapable(holder.message.getFolder().getAccount()) == true && folderName != null)
{
if (K9.FOLDER_NONE.equalsIgnoreCase(folderName)) {
return;
}
mAdapter.removeMessage(holder);
mController.moveMessage(holder.message.getFolder().getAccount(), holder.message.getFolder().getName(), holder.message, folderName, null);
}
@ -1293,11 +1327,18 @@ public class MessageList
onCopyBatch();
return true;
case R.id.batch_archive_op:
onArchiveBatch();
return true;
case R.id.batch_spam_op:
onSpamBatch();
return true;
case R.id.batch_move_op:
onMoveBatch();
return true;
case R.id.expunge:
if (mCurrentFolder != null)
{
@ -1311,7 +1352,8 @@ public class MessageList
}
private final int[] batch_ops = { R.id.batch_copy_op, R.id.batch_delete_op, R.id.batch_flag_op,
R.id.batch_unflag_op, R.id.batch_mark_read_op, R.id.batch_mark_unread_op, R.id.batch_move_op ,
R.id.batch_unflag_op, R.id.batch_mark_read_op, R.id.batch_mark_unread_op,
R.id.batch_archive_op, R.id.batch_spam_op, R.id.batch_move_op,
R.id.batch_select_all, R.id.batch_deselect_all
};
@ -1343,6 +1385,8 @@ public class MessageList
menu.findItem(R.id.account_settings).setVisible(false);
menu.findItem(R.id.list_folders).setVisible(false);
menu.findItem(R.id.expunge).setVisible(false);
menu.findItem(R.id.batch_archive_op).setVisible(false);
menu.findItem(R.id.batch_spam_op).setVisible(false);
menu.findItem(R.id.batch_move_op).setVisible(false);
menu.findItem(R.id.batch_copy_op).setVisible(false);
menu.findItem(R.id.check_mail).setVisible(false);
@ -1383,15 +1427,13 @@ public class MessageList
super.onCreateOptionsMenu(menu);
getMenuInflater().inflate(R.menu.message_list_option, menu);
return true;
}
@Override
public boolean onContextItemSelected(MenuItem item)
{
AdapterContextMenuInfo info = (AdapterContextMenuInfo) item .getMenuInfo();
AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();
MessageInfoHolder holder = (MessageInfoHolder) mAdapter.getItem(info.position);
switch (item.getItemId())
@ -1436,6 +1478,16 @@ public class MessageList
break;
case R.id.archive:
onArchive(holder);
break;
case R.id.spam:
onSpam(holder);
break;
case R.id.move:
onMove(holder);
@ -1556,15 +1608,28 @@ public class MessageList
menu.findItem(R.id.flag).setTitle(R.string.unflag_action);
}
if (mController.isCopyCapable(message.message.getFolder().getAccount()) == false)
Account account = message.message.getFolder().getAccount();
if (mController.isCopyCapable(account) == false)
{
menu.findItem(R.id.copy).setVisible(false);
}
if (mController.isMoveCapable(message.message.getFolder().getAccount()) == false)
if (mController.isMoveCapable(account) == false)
{
menu.findItem(R.id.move).setVisible(false);
menu.findItem(R.id.archive).setVisible(false);
menu.findItem(R.id.spam).setVisible(false);
}
if (K9.FOLDER_NONE.equalsIgnoreCase(account.getArchiveFolderName()))
{
menu.findItem(R.id.archive).setVisible(false);
}
if (K9.FOLDER_NONE.equalsIgnoreCase(account.getSpamFolderName()))
{
menu.findItem(R.id.spam).setVisible(false);
}
if (message.selected)
{
menu.findItem(R.id.select).setVisible(false);
@ -2885,6 +2950,7 @@ public class MessageList
intent.putExtra(ChooseFolder.EXTRA_SEL_FOLDER, folder.getAccount().getLastSelectedFolderName());
startActivityForResult(intent, ACTIVITY_CHOOSE_FOLDER_MOVE_BATCH);
}
private void onMoveChosenBatch(String folderName)
{
if (mController.isMoveCapable(mAccount) == false)
@ -2915,6 +2981,65 @@ public class MessageList
mSelectedCount = 0;
toggleBatchButtons();
}
private void onArchiveBatch()
{
if (mController.isMoveCapable(mAccount) == false)
{
return;
}
Account account = null;
for (MessageInfoHolder holder : mAdapter.messages)
{
if (holder.selected)
{
Message message = holder.message;
if (mController.isMoveCapable(message) == false)
{
Toast toast = Toast.makeText(this, R.string.move_copy_cannot_copy_unsynced_message, Toast.LENGTH_LONG);
toast.show();
return;
}
}
}
String folderName = mAccount.getArchiveFolderName();
if (K9.FOLDER_NONE.equalsIgnoreCase(folderName))
{
return;
}
onMoveChosenBatch(folderName);
}
private void onSpamBatch()
{
if (mController.isMoveCapable(mAccount) == false)
{
return;
}
Account account = null;
for (MessageInfoHolder holder : mAdapter.messages)
{
if (holder.selected)
{
Message message = holder.message;
if (mController.isMoveCapable(message) == false)
{
Toast toast = Toast.makeText(this, R.string.move_copy_cannot_copy_unsynced_message, Toast.LENGTH_LONG);
toast.show();
return;
}
}
}
String folderName = mAccount.getSpamFolderName();
if (K9.FOLDER_NONE.equalsIgnoreCase(folderName))
{
return;
}
onMoveChosenBatch(folderName);
}
private void onCopyBatch()
{
if (mController.isCopyCapable(mAccount) == false)
@ -2942,6 +3067,7 @@ public class MessageList
intent.putExtra(ChooseFolder.EXTRA_SEL_FOLDER, folder.getAccount().getLastSelectedFolderName());
startActivityForResult(intent, ACTIVITY_CHOOSE_FOLDER_COPY_BATCH);
}
private void onCopyChosenBatch(String folderName)
{
if (mController.isCopyCapable(mAccount) == false)

View file

@ -1,5 +1,19 @@
package com.fsck.k9.activity;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import org.apache.commons.io.IOUtils;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
@ -21,30 +35,46 @@ import android.text.style.StyleSpan;
import android.util.Config;
import android.util.Log;
import android.util.TypedValue;
import android.view.*;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.Animation;
import android.view.animation.TranslateAnimation;
import android.webkit.*;
import android.widget.*;
import com.fsck.k9.*;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import android.widget.Toast;
import com.fsck.k9.Account;
import com.fsck.k9.FontSizes;
import com.fsck.k9.K9;
import com.fsck.k9.Preferences;
import com.fsck.k9.R;
import com.fsck.k9.controller.MessagingController;
import com.fsck.k9.controller.MessagingListener;
import com.fsck.k9.mail.*;
import com.fsck.k9.mail.Address;
import com.fsck.k9.mail.Flag;
import com.fsck.k9.mail.Message;
import com.fsck.k9.mail.Message.RecipientType;
import com.fsck.k9.mail.MessagingException;
import com.fsck.k9.mail.Multipart;
import com.fsck.k9.mail.Part;
import com.fsck.k9.mail.internet.MimeUtility;
import com.fsck.k9.mail.store.LocalStore.LocalAttachmentBodyPart;
import com.fsck.k9.mail.store.LocalStore.LocalMessage;
import com.fsck.k9.mail.store.LocalStore.LocalTextBody;
import com.fsck.k9.provider.AttachmentProvider;
import org.apache.commons.io.IOUtils;
import java.io.*;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
public class MessageView extends K9Activity implements OnClickListener
{
@ -53,7 +83,6 @@ public class MessageView extends K9Activity implements OnClickListener
private static final String EXTRA_NEXT = "com.fsck.k9.MessageView_next";
private static final int ACTIVITY_CHOOSE_FOLDER_MOVE = 1;
private static final int ACTIVITY_CHOOSE_FOLDER_COPY = 2;
private TextView mFromView;
@ -76,6 +105,12 @@ public class MessageView extends K9Activity implements OnClickListener
View next_scrolling;
View previous;
View previous_scrolling;
private View mArchive;
private View mMove;
private View mSpam;
private View mArchiveScrolling;
private View mMoveScrolling;
private View mSpamScrolling;
private Account mAccount;
private MessageReference mMessageReference;
@ -174,6 +209,16 @@ public class MessageView extends K9Activity implements OnClickListener
onMove();
return true;
}
case KeyEvent.KEYCODE_S:
{
onSpam();
return true;
}
case KeyEvent.KEYCODE_V:
{
onArchive();
return true;
}
case KeyEvent.KEYCODE_Y:
{
onCopy();
@ -650,6 +695,9 @@ public class MessageView extends K9Activity implements OnClickListener
setOnClickListener(R.id.forward);
setOnClickListener(R.id.next);
setOnClickListener(R.id.previous);
setOnClickListener(R.id.archive);
setOnClickListener(R.id.move);
setOnClickListener(R.id.spam);
// To show full header
setOnClickListener(R.id.header_container);
@ -660,10 +708,12 @@ public class MessageView extends K9Activity implements OnClickListener
setOnClickListener(R.id.forward_scrolling);
setOnClickListener(R.id.next_scrolling);
setOnClickListener(R.id.previous_scrolling);
setOnClickListener(R.id.archive_scrolling);
setOnClickListener(R.id.move_scrolling);
setOnClickListener(R.id.spam_scrolling);
setOnClickListener(R.id.show_pictures);
setTitle("");
Intent intent = getIntent();
@ -726,12 +776,16 @@ public class MessageView extends K9Activity implements OnClickListener
next = findViewById(R.id.next);
previous = findViewById(R.id.previous);
setOnClickListener(R.id.next);
setOnClickListener(R.id.previous);
next_scrolling = findViewById(R.id.next_scrolling);
previous_scrolling = findViewById(R.id.previous_scrolling);
mArchive = findViewById(R.id.archive);
mMove = findViewById(R.id.move);
mSpam = findViewById(R.id.spam);
mArchiveScrolling = findViewById(R.id.archive_scrolling);
mMoveScrolling = findViewById(R.id.move_scrolling);
mSpamScrolling = findViewById(R.id.spam_scrolling);
boolean goNext = intent.getBooleanExtra(EXTRA_NEXT, false);
if (goNext)
@ -763,6 +817,43 @@ public class MessageView extends K9Activity implements OnClickListener
showButtons();
}
}
Account.HideButtons hideMoveButtons = mAccount.getHideMessageViewMoveButtons();
if (Account.HideButtons.ALWAYS == hideMoveButtons)
{
hideMoveButtons();
}
else if (Account.HideButtons.NEVER == hideMoveButtons)
{
showMoveButtons();
}
else // Account.HideButtons.KEYBOARD_AVAIL
{
final Configuration config = this.getResources().getConfiguration();
if (config.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_NO)
{
hideMoveButtons();
}
else
{
showMoveButtons();
}
}
if (!mAccount.getEnableMoveButtons())
{
View buttons = findViewById(R.id.move_buttons);
if (buttons != null)
{
buttons.setVisibility(View.GONE);
}
buttons = findViewById(R.id.scrolling_move_buttons);
if (buttons != null)
{
buttons.setVisibility(View.GONE);
}
}
displayMessage(mMessageReference);
}
@ -787,7 +878,6 @@ public class MessageView extends K9Activity implements OnClickListener
mAttachments.removeAllViews();
findSurroundingMessagesUid();
boolean enableNext = (mNextMessage != null);
boolean enablePrev = (mPreviousMessage != null);
@ -801,6 +891,33 @@ public class MessageView extends K9Activity implements OnClickListener
if (previous_scrolling != null && (previous_scrolling.isEnabled() != enablePrev))
previous_scrolling.setEnabled(enablePrev);
// If moving isn't support at all, then all of them must be disabled anyway.
if (MessagingController.getInstance(getApplication()).isMoveCapable(mAccount) == false)
{
mArchive.setEnabled(false);
mMove.setEnabled(false);
mSpam.setEnabled(false);
mArchiveScrolling.setEnabled(false);
mMoveScrolling.setEnabled(false);
mSpamScrolling.setEnabled(false);
}
else
{
// Only enable the button if the Archive folder is not the current folder and not NONE.
boolean enableArchive = !mMessageReference.folderName.equals(mAccount.getArchiveFolderName()) &&
!K9.FOLDER_NONE.equalsIgnoreCase(mAccount.getArchiveFolderName());
boolean enableMove = true;
// Only enable the button if the Spam folder is not the current folder and not NONE.
boolean enableSpam = !mMessageReference.folderName.equals(mAccount.getSpamFolderName()) &&
!K9.FOLDER_NONE.equalsIgnoreCase(mAccount.getSpamFolderName());
mArchive.setEnabled(enableArchive);
mMove.setEnabled(enableMove);
mSpam.setEnabled(enableSpam);
mArchiveScrolling.setEnabled(enableArchive);
mMoveScrolling.setEnabled(enableMove);
mSpamScrolling.setEnabled(enableSpam);
}
MessagingController.getInstance(getApplication()).loadMessageForView(
mAccount,
mMessageReference.folderName,
@ -830,6 +947,24 @@ public class MessageView extends K9Activity implements OnClickListener
}
}
private void showMoveButtons()
{
View buttons = findViewById(R.id.scrolling_move_buttons);
if (buttons != null)
{
buttons.setVisibility(View.GONE);
}
}
private void hideMoveButtons()
{
View buttons = findViewById(R.id.move_buttons);
if (buttons != null)
{
buttons.setVisibility(View.GONE);
}
}
private void setOnClickListener(int viewCode)
{
View thisView = findViewById(viewCode);
@ -878,6 +1013,54 @@ public class MessageView extends K9Activity implements OnClickListener
}
}
private void onArchive()
{
if (MessagingController.getInstance(getApplication()).isMoveCapable(mAccount) == false)
{
return;
}
if (MessagingController.getInstance(getApplication()).isMoveCapable(mMessage) == false)
{
Toast toast = Toast.makeText(this, R.string.move_copy_cannot_copy_unsynced_message, Toast.LENGTH_LONG);
toast.show();
return;
}
String srcFolder = mMessageReference.folderName;
String dstFolder = mAccount.getArchiveFolderName();
Message messageToMove = mMessage;
if (K9.FOLDER_NONE.equalsIgnoreCase(dstFolder)) {
return;
}
showNextMessage();
MessagingController.getInstance(getApplication())
.moveMessage(mAccount, srcFolder, messageToMove, dstFolder, null);
}
private void onSpam()
{
if (MessagingController.getInstance(getApplication()).isMoveCapable(mAccount) == false)
{
return;
}
if (MessagingController.getInstance(getApplication()).isMoveCapable(mMessage) == false)
{
Toast toast = Toast.makeText(this, R.string.move_copy_cannot_copy_unsynced_message, Toast.LENGTH_LONG);
toast.show();
return;
}
String srcFolder = mMessageReference.folderName;
String dstFolder = mAccount.getSpamFolderName();
Message messageToMove = mMessage;
if (K9.FOLDER_NONE.equalsIgnoreCase(dstFolder)) {
return;
}
showNextMessage();
MessagingController.getInstance(getApplication())
.moveMessage(mAccount, srcFolder, messageToMove, dstFolder, null);
}
private void showNextMessage()
{
findSurroundingMessagesUid();
@ -904,7 +1087,7 @@ public class MessageView extends K9Activity implements OnClickListener
finish();
}
}
private void onClickSender()
{
if (mMessage != null)
@ -1275,6 +1458,18 @@ public class MessageView extends K9Activity implements OnClickListener
case R.id.forward_scrolling:
onForward();
break;
case R.id.archive:
case R.id.archive_scrolling:
onArchive();
break;
case R.id.spam:
case R.id.spam_scrolling:
onSpam();
break;
case R.id.move:
case R.id.move_scrolling:
onMove();
break;
case R.id.next:
case R.id.next_scrolling:
onNext(K9.isAnimations());
@ -1324,6 +1519,12 @@ public class MessageView extends K9Activity implements OnClickListener
case R.id.flag:
onFlag();
break;
case R.id.archive:
onArchive();
break;
case R.id.spam:
onSpam();
break;
case R.id.move:
onMove();
break;
@ -1353,6 +1554,16 @@ public class MessageView extends K9Activity implements OnClickListener
if (MessagingController.getInstance(getApplication()).isMoveCapable(mAccount) == false)
{
menu.findItem(R.id.move).setVisible(false);
menu.findItem(R.id.archive).setVisible(false);
menu.findItem(R.id.spam).setVisible(false);
}
if (K9.FOLDER_NONE.equalsIgnoreCase(mAccount.getArchiveFolderName()))
{
menu.findItem(R.id.archive).setVisible(false);
}
if (K9.FOLDER_NONE.equalsIgnoreCase(mAccount.getSpamFolderName()))
{
menu.findItem(R.id.spam).setVisible(false);
}
return true;
}

View file

@ -34,6 +34,8 @@ public class AccountSettings extends K9PreferenceActivity
private static final String PREFERENCE_DISPLAY_COUNT = "account_display_count";
private static final String PREFERENCE_DEFAULT = "account_default";
private static final String PREFERENCE_HIDE_BUTTONS = "hide_buttons_enum";
private static final String PREFERENCE_HIDE_MOVE_BUTTONS = "hide_move_buttons_enum";
private static final String PREFERENCE_ENABLE_MOVE_BUTTONS = "enable_move_buttons";
private static final String PREFERENCE_NOTIFY = "account_notify";
private static final String PREFERENCE_NOTIFY_SELF = "account_notify_self";
private static final String PREFERENCE_NOTIFY_SYNC = "account_notify_sync";
@ -69,6 +71,8 @@ public class AccountSettings extends K9PreferenceActivity
private CheckBoxPreference mAccountNotify;
private CheckBoxPreference mAccountNotifySelf;
private ListPreference mAccountHideButtons;
private ListPreference mAccountHideMoveButtons;
private CheckBoxPreference mAccountEnableMoveButtons;
private CheckBoxPreference mAccountNotifySync;
private CheckBoxPreference mAccountVibrate;
private ListPreference mAccountVibratePattern;
@ -293,7 +297,7 @@ public class AccountSettings extends K9PreferenceActivity
return false;
}
});
mMessageAge = (ListPreference) findPreference(PREFERENCE_MESSAGE_AGE);
mMessageAge.setValue(String.valueOf(mAccount.getMaximumPolledMessageAge()));
mMessageAge.setSummary(mMessageAge.getEntry());
@ -329,6 +333,24 @@ public class AccountSettings extends K9PreferenceActivity
}
});
mAccountEnableMoveButtons = (CheckBoxPreference) findPreference(PREFERENCE_ENABLE_MOVE_BUTTONS);
mAccountEnableMoveButtons.setChecked(mAccount.getEnableMoveButtons());
mAccountHideMoveButtons = (ListPreference) findPreference(PREFERENCE_HIDE_MOVE_BUTTONS);
mAccountHideMoveButtons.setValue("" + mAccount.getHideMessageViewMoveButtons());
mAccountHideMoveButtons.setSummary(mAccountHideMoveButtons.getEntry());
mAccountHideMoveButtons.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener()
{
public boolean onPreferenceChange(Preference preference, Object newValue)
{
final String summary = newValue.toString();
int index = mAccountHideMoveButtons.findIndexOfValue(summary);
mAccountHideMoveButtons.setSummary(mAccountHideMoveButtons.getEntries()[index]);
mAccountHideMoveButtons.setValue(summary);
return false;
}
});
mAccountNotify = (CheckBoxPreference) findPreference(PREFERENCE_NOTIFY);
mAccountNotify.setChecked(mAccount.isNotifyNewMail());
@ -528,6 +550,8 @@ public class AccountSettings extends K9PreferenceActivity
}
mAccount.setHideMessageViewButtons(Account.HideButtons.valueOf(mAccountHideButtons.getValue()));
mAccount.setHideMessageViewMoveButtons(Account.HideButtons.valueOf(mAccountHideMoveButtons.getValue()));
mAccount.setEnableMoveButtons(mAccountEnableMoveButtons.isChecked());
mAccount.setAutoExpandFolderName(reverseTranslateFolder(mAutoExpandFolder.getSummary().toString()));
mAccount.save(Preferences.getPreferences(this));
if (needsRefresh && needsPushRestart)