summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Mantler <nicoya@google.com>2014-08-18 15:59:01 -0700
committerTony Mantler <nicoya@google.com>2014-08-19 13:47:26 -0700
commitea4324463814230a49dbfd07232416548ddcee45 (patch)
tree0a34557d3b6886e0fcfb5a6133aeb470f5d6000b
parenta810584e5b0f64c71fa2b05a91782e28ef98bd87 (diff)
downloadandroid_packages_apps_UnifiedEmail-ea4324463814230a49dbfd07232416548ddcee45.tar.gz
android_packages_apps_UnifiedEmail-ea4324463814230a49dbfd07232416548ddcee45.tar.bz2
android_packages_apps_UnifiedEmail-ea4324463814230a49dbfd07232416548ddcee45.zip
Tweak swipe to archive/delete prefs
b/16983964 Change-Id: I56c19c0f6e2939ea71aa1f171e5ad6f7cfd2feca
-rw-r--r--res/values/strings.xml21
-rw-r--r--res/xml/general_preferences.xml2
-rw-r--r--src/com/android/mail/preferences/MailPrefs.java10
-rw-r--r--src/com/android/mail/ui/settings/GeneralPrefsFragment.java11
4 files changed, 17 insertions, 27 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 94071d86b..67af422b0 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -798,26 +798,23 @@
<string name="silent_ringtone">Silent</string>
<!-- Settings screen, preference name for archive vs. delete [CHAR LIMIT=50] -->
- <string name="preference_removal_action_title">Archive &amp; delete actions</string>
+ <string name="preference_removal_action_title">Default action</string>
<!-- Options to select from for whether to have archive or delete as the remove action [CHAR LIMIT=50] -->
<string-array name="prefEntries_removal_action">
- <item>Show archive only</item>
- <item>Show delete only</item>
- <item>Show archive &amp; delete</item>
+ <item>Archive</item>
+ <item>Delete</item>
</string-array>
<!-- Description of currently selected option of whether to use archive or delete as remove action [CHAR LIMIT=200] -->
<string-array name="prefSummaries_removal_action_summary">
- <item>Show archive only</item>
- <item>Show delete only</item>
- <item>Show archive &amp; delete</item>
+ <item>Archive</item>
+ <item>Delete</item>
</string-array>
<string-array translatable="false" name="prefValues_removal_action">
<item>archive</item>
<item>delete</item>
- <item>archive-and-delete</item>
</string-array>
<!-- Dialog title for the choosing whether to use archive or delete as remove action [CHAR LIMIT=150] -->
- <string name="prefDialogTitle_removal_action">Archive &amp; delete actions</string>
+ <string name="prefDialogTitle_removal_action">Default action</string>
<!-- The default value -->
<string translatable="false" name="prefDefault_removal_action">archive</string>
@@ -828,10 +825,8 @@
<!-- DO NOT TRANSLATE THE BELOW STRING - In order to allow overriding of this for K tablets (but not pre-K tablets), we use an indirection with the actual string defined above. -->
<string name="preferences_default_reply_all_summary" translatable="false">@string/preferences_default_reply_all_summary_impl</string>
- <!-- Preference name for swipe action when action is archive [CHAR LIMIT=100]-->
- <string name="preference_swipe_title_archive">Swipe to archive</string>
- <!-- Preference name for swipe action when action is delete [CHAR LIMIT=100]-->
- <string name="preference_swipe_title_delete">Swipe to delete</string>
+ <!-- Preference name for swipe actions preference [CHAR LIMIT=100]-->
+ <string name="preference_swipe_title">Swipe actions</string>
<!-- Preference description swiping in conversation list option [CHAR LIMIT=100] -->
<string name="preference_swipe_description">In conversation list</string>
diff --git a/res/xml/general_preferences.xml b/res/xml/general_preferences.xml
index 991d59881..cb728d68f 100644
--- a/res/xml/general_preferences.xml
+++ b/res/xml/general_preferences.xml
@@ -34,7 +34,7 @@
android:key="conversation-list-swipe"
android:persistent="true"
android:summary="@string/preference_swipe_description"
- android:title="@string/preference_swipe_title_archive" />
+ android:title="@string/preference_swipe_title" />
<CheckBoxPreference
android:defaultValue="true"
diff --git a/src/com/android/mail/preferences/MailPrefs.java b/src/com/android/mail/preferences/MailPrefs.java
index cb4eb01ae..4d6957ded 100644
--- a/src/com/android/mail/preferences/MailPrefs.java
+++ b/src/com/android/mail/preferences/MailPrefs.java
@@ -20,6 +20,7 @@ package com.android.mail.preferences;
import android.content.Context;
import android.content.SharedPreferences;
import android.support.annotation.StringDef;
+import android.text.TextUtils;
import com.android.mail.R;
import com.android.mail.providers.Account;
@@ -143,13 +144,13 @@ public final class MailPrefs extends VersionedPrefs {
@Retention(RetentionPolicy.SOURCE)
@StringDef({
RemovalActions.ARCHIVE,
- RemovalActions.ARCHIVE_AND_DELETE,
RemovalActions.DELETE
})
public @interface RemovalActionTypes {}
public static final class RemovalActions {
public static final String ARCHIVE = "archive";
public static final String DELETE = "delete";
+ @Deprecated
public static final String ARCHIVE_AND_DELETE = "archive-and-delete";
}
@@ -243,8 +244,13 @@ public final class MailPrefs extends VersionedPrefs {
}
final SharedPreferences sharedPreferences = getSharedPreferences();
+ final String removalAction =
+ sharedPreferences.getString(PreferenceKeys.REMOVAL_ACTION, null);
+ if (TextUtils.equals(removalAction, RemovalActions.ARCHIVE_AND_DELETE)) {
+ return RemovalActions.ARCHIVE;
+ }
return sharedPreferences.getString(PreferenceKeys.REMOVAL_ACTION,
- RemovalActions.ARCHIVE_AND_DELETE);
+ RemovalActions.ARCHIVE);
}
/**
diff --git a/src/com/android/mail/ui/settings/GeneralPrefsFragment.java b/src/com/android/mail/ui/settings/GeneralPrefsFragment.java
index d3b19c3ae..b33ec6db7 100644
--- a/src/com/android/mail/ui/settings/GeneralPrefsFragment.java
+++ b/src/com/android/mail/ui/settings/GeneralPrefsFragment.java
@@ -122,7 +122,6 @@ public class GeneralPrefsFragment extends MailPreferenceFragment
if (PreferenceKeys.REMOVAL_ACTION.equals(key)) {
final String removalAction = newValue.toString();
mMailPrefs.setRemovalAction(removalAction);
- updateListSwipeTitle(removalAction);
} else if (AUTO_ADVANCE_WIDGET.equals(key)) {
final int prefsAutoAdvanceMode =
AUTO_ADVANCE_VALUES[mAutoAdvance.findIndexOfValue((String) newValue)];
@@ -204,9 +203,6 @@ public class GeneralPrefsFragment extends MailPreferenceFragment
mMailPrefs.getAutoAdvanceMode(), AutoAdvance.DEFAULT);
mAutoAdvance.setValueIndex(autoAdvanceModeIndex);
- final String removalAction = mMailPrefs.getRemovalAction(supportsArchive());
- updateListSwipeTitle(removalAction);
-
listenForPreferenceChange(
PreferenceKeys.REMOVAL_ACTION,
PreferenceKeys.CONVERSATION_LIST_SWIPE,
@@ -258,11 +254,4 @@ public class GeneralPrefsFragment extends MailPreferenceFragment
}
}
}
-
- private void updateListSwipeTitle(final String removalAction) {
- final CheckBoxPreference listSwipePreference = (CheckBoxPreference)
- findPreference(MailPrefs.PreferenceKeys.CONVERSATION_LIST_SWIPE);
- listSwipePreference.setTitle(MailPrefs.RemovalActions.DELETE.equals(removalAction) ?
- R.string.preference_swipe_title_delete : R.string.preference_swipe_title_archive);
- }
}