diff options
| -rw-r--r-- | res/values/strings.xml | 4 | ||||
| -rw-r--r-- | res/xml/general_preferences.xml | 6 | ||||
| -rw-r--r-- | src/com/android/email/activity/setup/GeneralPreferences.java | 13 | ||||
| -rw-r--r-- | src/com/android/email/provider/EmailProvider.java | 9 | ||||
| -rw-r--r-- | src/com/android/mail/preferences/PreferenceMigrator.java | 6 |
5 files changed, 10 insertions, 28 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml index f6f12f559..5dadf3fd8 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -1119,10 +1119,6 @@ as <xliff:g id="filename">%s</xliff:g>.</string> <!-- General preference: Description of the setting for requiring confirmation before message deletion [CHAR LIMIT=64] --> <string name="general_preference_confirm_delete_summary">Messages</string> - <!-- General preference: Label of the setting for enabling swipe-to-delete [CHAR LIMIT=32] --> - <string name="general_preference_swipe_delete_label">Swipe to delete</string> - <!-- General preference: Description of the setting for enabling swipe-to-delete [CHAR LIMIT=64] --> - <string name="general_preference_swipe_delete_summary">Delete a message in the list by swiping</string> <!-- General preference: Label of the setting for requiring confirmation before message sending [CHAR LIMIT=32] --> <string name="general_preference_confirm_send_label">Confirm before sending</string> diff --git a/res/xml/general_preferences.xml b/res/xml/general_preferences.xml index e48d6288e..4223170f0 100644 --- a/res/xml/general_preferences.xml +++ b/res/xml/general_preferences.xml @@ -64,11 +64,11 @@ android:summary="@string/general_preference_reply_all_summary" /> <CheckBoxPreference - android:key="conversation-list-swipe-action" + android:key="conversation-list-swipe" android:persistent="false" android:defaultValue="true" - android:title="@string/general_preference_swipe_delete_label" - android:summary="@string/general_preference_swipe_delete_summary" /> + android:title="@string/preference_swipe_title" + android:summary="@string/preference_swipe_description" /> <PreferenceScreen android:key="clear_trusted_senders" diff --git a/src/com/android/email/activity/setup/GeneralPreferences.java b/src/com/android/email/activity/setup/GeneralPreferences.java index 71f376954..d57375065 100644 --- a/src/com/android/email/activity/setup/GeneralPreferences.java +++ b/src/com/android/email/activity/setup/GeneralPreferences.java @@ -39,7 +39,6 @@ public class GeneralPreferences extends EmailPreferenceFragment implements private static final String PREFERENCE_KEY_CONFIRM_DELETE = "confirm_delete"; private static final String PREFERENCE_KEY_CONFIRM_SEND = "confirm_send"; private static final String PREFERENCE_KEY_CONV_LIST_ICON = "conversation_list_icon"; - private static final String PREFERENCE_KEY_SWIPE_DELETE = "swipe_delete"; private static final String PREFERENCE_KEY_CLEAR_TRUSTED_SENDERS = "clear_trusted_senders"; private MailPrefs mMailPrefs; @@ -138,11 +137,8 @@ public class GeneralPreferences extends EmailPreferenceFragment implements } else if (PREFERENCE_KEY_CONFIRM_SEND.equals(key)) { mPreferences.setConfirmSend(mConfirmSend.isChecked()); return true; - } else if (MailPrefs.PreferenceKeys.CONVERSATION_LIST_SWIPE_ACTION.equals(key)) { - mMailPrefs - .setConversationListSwipeAction(mSwipeDelete.isChecked() - ? MailPrefs.ConversationListSwipeActions.DELETE - : MailPrefs.ConversationListSwipeActions.DISABLED); + } else if (MailPrefs.PreferenceKeys.CONVERSATION_LIST_SWIPE.equals(key)) { + mMailPrefs.setConversationListSwipeEnabled(mSwipeDelete.isChecked()); return true; } return false; @@ -169,9 +165,8 @@ public class GeneralPreferences extends EmailPreferenceFragment implements mConfirmDelete = (CheckBoxPreference) findPreference(PREFERENCE_KEY_CONFIRM_DELETE); mConfirmSend = (CheckBoxPreference) findPreference(PREFERENCE_KEY_CONFIRM_SEND); mSwipeDelete = (CheckBoxPreference) - findPreference(MailPrefs.PreferenceKeys.CONVERSATION_LIST_SWIPE_ACTION); - mSwipeDelete.setChecked(MailPrefs.ConversationListSwipeActions.DELETE.equals( - mMailPrefs.getConversationListSwipeAction(false))); + findPreference(MailPrefs.PreferenceKeys.CONVERSATION_LIST_SWIPE); + mSwipeDelete.setChecked(mMailPrefs.getIsConversationListSwipeEnabled()); final CheckBoxPreference replyAllPreference = (CheckBoxPreference) findPreference(MailPrefs.PreferenceKeys.DEFAULT_REPLY_ALL); diff --git a/src/com/android/email/provider/EmailProvider.java b/src/com/android/email/provider/EmailProvider.java index 2f231b1a9..bcbc4858f 100644 --- a/src/com/android/email/provider/EmailProvider.java +++ b/src/com/android/email/provider/EmailProvider.java @@ -111,8 +111,6 @@ import java.io.FileNotFoundException; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collection; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; @@ -297,9 +295,6 @@ public class EmailProvider extends ContentProvider { // Query parameter indicating the command came from UIProvider private static final String IS_UIPROVIDER = "is_uiprovider"; - private static final String SWIPE_DELETE = Integer.toString(Swipe.DELETE); - private static final String SWIPE_DISABLED = Integer.toString(Swipe.DISABLED); - /** * Wrap the UriMatcher call so we can throw a runtime exception if an unknown Uri is passed in * @param uri the Uri to match @@ -2538,9 +2533,7 @@ public class EmailProvider extends ContentProvider { } if (projectionColumns.contains(UIProvider.AccountColumns.SettingsColumns.SWIPE)) { values.put(UIProvider.AccountColumns.SettingsColumns.SWIPE, - MailPrefs.ConversationListSwipeActions.DELETE.equals(mailPrefs - .getConversationListSwipeAction(false)) - ? SWIPE_DELETE : SWIPE_DISABLED); + mailPrefs.getConversationListSwipeActionInteger(false)); } if (projectionColumns.contains( UIProvider.AccountColumns.SettingsColumns.CONV_LIST_ICON)) { diff --git a/src/com/android/mail/preferences/PreferenceMigrator.java b/src/com/android/mail/preferences/PreferenceMigrator.java index 2cea8c513..e6c11b715 100644 --- a/src/com/android/mail/preferences/PreferenceMigrator.java +++ b/src/com/android/mail/preferences/PreferenceMigrator.java @@ -74,10 +74,8 @@ public class PreferenceMigrator extends BasePreferenceMigrator { final boolean hasSwipeDelete = preferences.hasSwipeDelete(); if (hasSwipeDelete) { @SuppressWarnings("deprecation") - final String swipeAction = - preferences.getSwipeDelete() ? MailPrefs.ConversationListSwipeActions.DELETE - : MailPrefs.ConversationListSwipeActions.DISABLED; - mailPrefs.setConversationListSwipeAction(swipeAction); + final boolean swipeDelete = preferences.getSwipeDelete(); + mailPrefs.setConversationListSwipeEnabled(swipeDelete); } // Move folder notification settings |
