Settings changes

Bug: 8685202
Change-Id: Ica781557b91e5ed43221f6e28b9d65cbb044ea55
This commit is contained in:
Scott Kennedy 2013-04-22 18:31:26 -07:00
parent 7ed75feb14
commit 643846abbd
5 changed files with 10 additions and 28 deletions

View File

@ -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>

View File

@ -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"

View File

@ -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);

View File

@ -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)) {

View File

@ -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