Merge pull request #3392 from k9mail/material_settings_screens

Switch 'general settings' to use PreferenceFragmentCompat
This commit is contained in:
cketti 2018-05-16 23:12:10 +02:00 committed by GitHub
commit 172ad93c21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 1120 additions and 1381 deletions

View file

@ -1,7 +1,7 @@
kotlinVersion=1.2.31
androidCompileSdkVersion=27
androidBuildToolsVersion=27.0.3
androidSupportLibraryVersion=27.0.2
androidSupportLibraryVersion=27.1.1
timberVersion=4.5.1
koinVersion=0.9.1
@ -10,5 +10,3 @@ junitVersion=4.12
mockitoVersion=2.18.0
okioVersion=1.14.0
truthVersion=0.35
android.enableAapt2=false

View file

@ -27,8 +27,12 @@ dependencies {
implementation 'commons-io:commons-io:2.4'
implementation "com.android.support:support-v4:${androidSupportLibraryVersion}"
implementation "com.android.support:appcompat-v7:${androidSupportLibraryVersion}"
implementation "com.android.support:preference-v14:${androidSupportLibraryVersion}"
implementation 'com.takisoft.fix:preference-v7-datetimepicker:27.1.1.1'
implementation 'com.takisoft.fix:preference-v7-colorpicker:27.1.1.1'
implementation "com.android.support:recyclerview-v7:${androidSupportLibraryVersion}"
implementation "android.arch.lifecycle:extensions:1.1.0"
implementation 'androidx.core:core-ktx:0.3'
implementation 'org.jsoup:jsoup:1.11.2'
implementation 'de.cketti.library.changelog:ckchangelog:1.2.1'
implementation 'com.github.bumptech.glide:glide:3.6.1'

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="application_id" translatable="false">com.fsck.k9.debug</string>
</resources>

View file

@ -303,6 +303,10 @@
android:name=".ui.settings.AboutActivity"
android:label="@string/about_action" />
<activity
android:name=".ui.settings.general.GeneralSettingsActivity"
android:label="@string/general_settings_title" />
<receiver
android:name=".service.BootReceiver"
android:enabled="true">

View file

@ -38,7 +38,7 @@ public class ColorPickerDialog extends AlertDialog {
mColorChangedListener = listener;
@SuppressLint("InflateParams")
View view = LayoutInflater.from(context).inflate(R.layout.color_picker_dialog, null);
View view = LayoutInflater.from(context).inflate(R.layout.holo_color_picker_dialog, null);
mColorPicker = (ColorPicker) view.findViewById(R.id.color_picker);
mColorPicker.setColor(color);

View file

@ -1,580 +0,0 @@
package com.fsck.k9.activity.setup;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.preference.CheckBoxPreference;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceClickListener;
import android.preference.PreferenceScreen;
import android.text.TextUtils;
import android.widget.Toast;
import com.fsck.k9.K9;
import com.fsck.k9.K9.NotificationHideSubject;
import com.fsck.k9.K9.NotificationQuickDelete;
import com.fsck.k9.K9.SplitViewMode;
import com.fsck.k9.Preferences;
import com.fsck.k9.R;
import com.fsck.k9.activity.ColorPickerDialog;
import com.fsck.k9.activity.K9PreferenceActivity;
import com.fsck.k9.helper.FileBrowserHelper;
import com.fsck.k9.helper.FileBrowserHelper.FileBrowserFailOverCallback;
import com.fsck.k9.notification.NotificationController;
import com.fsck.k9.preferences.CheckBoxListPreference;
import com.fsck.k9.preferences.Storage;
import com.fsck.k9.preferences.StorageEditor;
import com.fsck.k9.preferences.TimePickerPreference;
import com.fsck.k9.service.MailService;
public class Prefs extends K9PreferenceActivity {
/**
* Immutable empty {@link CharSequence} array
*/
private static final CharSequence[] EMPTY_CHAR_SEQUENCE_ARRAY = new CharSequence[0];
/*
* Keys of the preferences defined in res/xml/global_preferences.xml
*/
private static final String PREFERENCE_LANGUAGE = "language";
private static final String PREFERENCE_THEME = "theme";
private static final String PREFERENCE_MESSAGE_VIEW_THEME = "messageViewTheme";
private static final String PREFERENCE_FIXED_MESSAGE_THEME = "fixed_message_view_theme";
private static final String PREFERENCE_COMPOSER_THEME = "message_compose_theme";
private static final String PREFERENCE_FONT_SIZE = "font_size";
private static final String PREFERENCE_ANIMATIONS = "animations";
private static final String PREFERENCE_GESTURES = "gestures";
private static final String PREFERENCE_VOLUME_NAVIGATION = "volume_navigation";
private static final String PREFERENCE_START_INTEGRATED_INBOX = "start_integrated_inbox";
private static final String PREFERENCE_CONFIRM_ACTIONS = "confirm_actions";
private static final String PREFERENCE_NOTIFICATION_HIDE_SUBJECT = "notification_hide_subject";
private static final String PREFERENCE_MEASURE_ACCOUNTS = "measure_accounts";
private static final String PREFERENCE_COUNT_SEARCH = "count_search";
private static final String PREFERENCE_HIDE_SPECIAL_ACCOUNTS = "hide_special_accounts";
private static final String PREFERENCE_MESSAGELIST_CHECKBOXES = "messagelist_checkboxes";
private static final String PREFERENCE_MESSAGELIST_PREVIEW_LINES = "messagelist_preview_lines";
private static final String PREFERENCE_MESSAGELIST_SENDER_ABOVE_SUBJECT = "messagelist_sender_above_subject";
private static final String PREFERENCE_MESSAGELIST_STARS = "messagelist_stars";
private static final String PREFERENCE_MESSAGELIST_SHOW_CORRESPONDENT_NAMES = "messagelist_show_correspondent_names";
private static final String PREFERENCE_MESSAGELIST_SHOW_CONTACT_NAME = "messagelist_show_contact_name";
private static final String PREFERENCE_MESSAGELIST_CONTACT_NAME_COLOR = "messagelist_contact_name_color";
private static final String PREFERENCE_MESSAGELIST_SHOW_CONTACT_PICTURE = "messagelist_show_contact_picture";
private static final String PREFERENCE_MESSAGELIST_COLORIZE_MISSING_CONTACT_PICTURES =
"messagelist_colorize_missing_contact_pictures";
private static final String PREFERENCE_MESSAGEVIEW_FIXEDWIDTH = "messageview_fixedwidth_font";
private static final String PREFERENCE_MESSAGEVIEW_VISIBLE_REFILE_ACTIONS = "messageview_visible_refile_actions";
private static final String PREFERENCE_MESSAGEVIEW_RETURN_TO_LIST = "messageview_return_to_list";
private static final String PREFERENCE_MESSAGEVIEW_SHOW_NEXT = "messageview_show_next";
private static final String PREFERENCE_QUIET_TIME_ENABLED = "quiet_time_enabled";
private static final String PREFERENCE_DISABLE_NOTIFICATION_DURING_QUIET_TIME =
"disable_notifications_during_quiet_time";
private static final String PREFERENCE_QUIET_TIME_STARTS = "quiet_time_starts";
private static final String PREFERENCE_QUIET_TIME_ENDS = "quiet_time_ends";
private static final String PREFERENCE_NOTIF_QUICK_DELETE = "notification_quick_delete";
private static final String PREFERENCE_LOCK_SCREEN_NOTIFICATION_VISIBILITY = "lock_screen_notification_visibility";
private static final String PREFERENCE_HIDE_USERAGENT = "privacy_hide_useragent";
private static final String PREFERENCE_HIDE_TIMEZONE = "privacy_hide_timezone";
private static final String PREFERENCE_HIDE_HOSTNAME_WHEN_CONNECTING = "privacy_hide_hostname_when_connecting";
private static final String PREFERENCE_AUTOFIT_WIDTH = "messageview_autofit_width";
private static final String PREFERENCE_BACKGROUND_OPS = "background_ops";
private static final String PREFERENCE_DEBUG_LOGGING = "debug_logging";
private static final String PREFERENCE_SENSITIVE_LOGGING = "sensitive_logging";
private static final String PREFERENCE_ATTACHMENT_DEF_PATH = "attachment_default_path";
private static final String PREFERENCE_BACKGROUND_AS_UNREAD_INDICATOR = "messagelist_background_as_unread_indicator";
private static final String PREFERENCE_THREADED_VIEW = "threaded_view";
private static final String PREFERENCE_FOLDERLIST_WRAP_NAME = "folderlist_wrap_folder_name";
private static final String PREFERENCE_SPLITVIEW_MODE = "splitview_mode";
private static final int ACTIVITY_CHOOSE_FOLDER = 1;
// Named indices for the mVisibleRefileActions field
private static final int VISIBLE_REFILE_ACTIONS_DELETE = 0;
private static final int VISIBLE_REFILE_ACTIONS_ARCHIVE = 1;
private static final int VISIBLE_REFILE_ACTIONS_MOVE = 2;
private static final int VISIBLE_REFILE_ACTIONS_COPY = 3;
private static final int VISIBLE_REFILE_ACTIONS_SPAM = 4;
private ListPreference mLanguage;
private ListPreference mTheme;
private CheckBoxPreference mFixedMessageTheme;
private ListPreference mMessageTheme;
private ListPreference mComposerTheme;
private CheckBoxPreference mAnimations;
private CheckBoxPreference mGestures;
private CheckBoxListPreference mVolumeNavigation;
private CheckBoxPreference mStartIntegratedInbox;
private CheckBoxListPreference mConfirmActions;
private ListPreference mNotificationHideSubject;
private CheckBoxPreference mMeasureAccounts;
private CheckBoxPreference mCountSearch;
private CheckBoxPreference mHideSpecialAccounts;
private ListPreference mPreviewLines;
private CheckBoxPreference mSenderAboveSubject;
private CheckBoxPreference mCheckboxes;
private CheckBoxPreference mStars;
private CheckBoxPreference mShowCorrespondentNames;
private CheckBoxPreference mShowContactName;
private CheckBoxPreference mChangeContactNameColor;
private CheckBoxPreference mShowContactPicture;
private CheckBoxPreference mColorizeMissingContactPictures;
private CheckBoxPreference mFixedWidth;
private CheckBoxPreference mReturnToList;
private CheckBoxPreference mShowNext;
private CheckBoxPreference mAutofitWidth;
private ListPreference mBackgroundOps;
private CheckBoxPreference mDebugLogging;
private CheckBoxPreference mSensitiveLogging;
private CheckBoxPreference mHideUserAgent;
private CheckBoxPreference mHideTimeZone;
private CheckBoxPreference mHideHostnameWhenConnecting;
private CheckBoxPreference mWrapFolderNames;
private CheckBoxListPreference mVisibleRefileActions;
private CheckBoxPreference mQuietTimeEnabled;
private CheckBoxPreference mDisableNotificationDuringQuietTime;
private com.fsck.k9.preferences.TimePickerPreference mQuietTimeStarts;
private com.fsck.k9.preferences.TimePickerPreference mQuietTimeEnds;
private ListPreference mNotificationQuickDelete;
private ListPreference mLockScreenNotificationVisibility;
private Preference mAttachmentPathPreference;
private CheckBoxPreference mBackgroundAsUnreadIndicator;
private CheckBoxPreference mThreadedView;
private ListPreference mSplitViewMode;
public static void actionPrefs(Context context) {
Intent i = new Intent(context, Prefs.class);
context.startActivity(i);
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.global_preferences);
mLanguage = (ListPreference) findPreference(PREFERENCE_LANGUAGE);
List<CharSequence> entryVector = new ArrayList<CharSequence>(Arrays.asList(mLanguage.getEntries()));
List<CharSequence> entryValueVector = new ArrayList<CharSequence>(Arrays.asList(mLanguage.getEntryValues()));
String supportedLanguages[] = getResources().getStringArray(R.array.supported_languages);
Set<String> supportedLanguageSet = new HashSet<String>(Arrays.asList(supportedLanguages));
for (int i = entryVector.size() - 1; i > -1; --i) {
if (!supportedLanguageSet.contains(entryValueVector.get(i))) {
entryVector.remove(i);
entryValueVector.remove(i);
}
}
initListPreference(mLanguage, K9.getK9Language(),
entryVector.toArray(EMPTY_CHAR_SEQUENCE_ARRAY),
entryValueVector.toArray(EMPTY_CHAR_SEQUENCE_ARRAY));
mTheme = setupListPreference(PREFERENCE_THEME, themeIdToName(K9.getK9Theme()));
mFixedMessageTheme = (CheckBoxPreference) findPreference(PREFERENCE_FIXED_MESSAGE_THEME);
mFixedMessageTheme.setChecked(K9.useFixedMessageViewTheme());
mMessageTheme = setupListPreference(PREFERENCE_MESSAGE_VIEW_THEME,
themeIdToName(K9.getK9MessageViewThemeSetting()));
mComposerTheme = setupListPreference(PREFERENCE_COMPOSER_THEME,
themeIdToName(K9.getK9ComposerThemeSetting()));
findPreference(PREFERENCE_FONT_SIZE).setOnPreferenceClickListener(
new Preference.OnPreferenceClickListener() {
public boolean onPreferenceClick(Preference preference) {
onFontSizeSettings();
return true;
}
});
mAnimations = (CheckBoxPreference)findPreference(PREFERENCE_ANIMATIONS);
mAnimations.setChecked(K9.showAnimations());
mGestures = (CheckBoxPreference)findPreference(PREFERENCE_GESTURES);
mGestures.setChecked(K9.gesturesEnabled());
mVolumeNavigation = (CheckBoxListPreference)findPreference(PREFERENCE_VOLUME_NAVIGATION);
mVolumeNavigation.setItems(new CharSequence[] {getString(R.string.volume_navigation_message), getString(R.string.volume_navigation_list)});
mVolumeNavigation.setCheckedItems(new boolean[] {K9.useVolumeKeysForNavigationEnabled(), K9.useVolumeKeysForListNavigationEnabled()});
mStartIntegratedInbox = (CheckBoxPreference)findPreference(PREFERENCE_START_INTEGRATED_INBOX);
mStartIntegratedInbox.setChecked(K9.startIntegratedInbox());
mConfirmActions = (CheckBoxListPreference) findPreference(PREFERENCE_CONFIRM_ACTIONS);
boolean canDeleteFromNotification = NotificationController.platformSupportsExtendedNotifications();
CharSequence[] confirmActionEntries = new CharSequence[canDeleteFromNotification ? 6 : 5];
boolean[] confirmActionValues = new boolean[confirmActionEntries.length];
int index = 0;
confirmActionEntries[index] = getString(R.string.global_settings_confirm_action_delete);
confirmActionValues[index++] = K9.confirmDelete();
confirmActionEntries[index] = getString(R.string.global_settings_confirm_action_delete_starred);
confirmActionValues[index++] = K9.confirmDeleteStarred();
if (canDeleteFromNotification) {
confirmActionEntries[index] = getString(R.string.global_settings_confirm_action_delete_notif);
confirmActionValues[index++] = K9.confirmDeleteFromNotification();
}
confirmActionEntries[index] = getString(R.string.global_settings_confirm_action_spam);
confirmActionValues[index++] = K9.confirmSpam();
confirmActionEntries[index] = getString(R.string.global_settings_confirm_menu_discard);
confirmActionValues[index++] = K9.confirmDiscardMessage();
confirmActionEntries[index] = getString(R.string.global_settings_confirm_menu_mark_all_read);
confirmActionValues[index++] = K9.confirmMarkAllRead();
mConfirmActions.setItems(confirmActionEntries);
mConfirmActions.setCheckedItems(confirmActionValues);
mNotificationHideSubject = setupListPreference(PREFERENCE_NOTIFICATION_HIDE_SUBJECT,
K9.getNotificationHideSubject().toString());
mMeasureAccounts = (CheckBoxPreference)findPreference(PREFERENCE_MEASURE_ACCOUNTS);
mMeasureAccounts.setChecked(K9.measureAccounts());
mCountSearch = (CheckBoxPreference)findPreference(PREFERENCE_COUNT_SEARCH);
mCountSearch.setChecked(K9.countSearchMessages());
mHideSpecialAccounts = (CheckBoxPreference)findPreference(PREFERENCE_HIDE_SPECIAL_ACCOUNTS);
mHideSpecialAccounts.setChecked(K9.isHideSpecialAccounts());
mPreviewLines = setupListPreference(PREFERENCE_MESSAGELIST_PREVIEW_LINES,
Integer.toString(K9.messageListPreviewLines()));
mSenderAboveSubject = (CheckBoxPreference)findPreference(PREFERENCE_MESSAGELIST_SENDER_ABOVE_SUBJECT);
mSenderAboveSubject.setChecked(K9.messageListSenderAboveSubject());
mCheckboxes = (CheckBoxPreference)findPreference(PREFERENCE_MESSAGELIST_CHECKBOXES);
mCheckboxes.setChecked(K9.messageListCheckboxes());
mStars = (CheckBoxPreference)findPreference(PREFERENCE_MESSAGELIST_STARS);
mStars.setChecked(K9.messageListStars());
mShowCorrespondentNames = (CheckBoxPreference)findPreference(PREFERENCE_MESSAGELIST_SHOW_CORRESPONDENT_NAMES);
mShowCorrespondentNames.setChecked(K9.showCorrespondentNames());
mShowContactName = (CheckBoxPreference)findPreference(PREFERENCE_MESSAGELIST_SHOW_CONTACT_NAME);
mShowContactName.setChecked(K9.showContactName());
mShowContactPicture = (CheckBoxPreference)findPreference(PREFERENCE_MESSAGELIST_SHOW_CONTACT_PICTURE);
mShowContactPicture.setChecked(K9.showContactPicture());
mColorizeMissingContactPictures = (CheckBoxPreference)findPreference(
PREFERENCE_MESSAGELIST_COLORIZE_MISSING_CONTACT_PICTURES);
mColorizeMissingContactPictures.setChecked(K9.isColorizeMissingContactPictures());
mBackgroundAsUnreadIndicator = (CheckBoxPreference)findPreference(PREFERENCE_BACKGROUND_AS_UNREAD_INDICATOR);
mBackgroundAsUnreadIndicator.setChecked(K9.useBackgroundAsUnreadIndicator());
mChangeContactNameColor = (CheckBoxPreference)findPreference(PREFERENCE_MESSAGELIST_CONTACT_NAME_COLOR);
mChangeContactNameColor.setChecked(K9.changeContactNameColor());
mThreadedView = (CheckBoxPreference) findPreference(PREFERENCE_THREADED_VIEW);
mThreadedView.setChecked(K9.isThreadedViewEnabled());
if (K9.changeContactNameColor()) {
mChangeContactNameColor.setSummary(R.string.global_settings_registered_name_color_changed);
} else {
mChangeContactNameColor.setSummary(R.string.global_settings_registered_name_color_default);
}
mChangeContactNameColor.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
public boolean onPreferenceChange(Preference preference, Object newValue) {
final Boolean checked = (Boolean) newValue;
if (checked) {
onChooseContactNameColor();
mChangeContactNameColor.setSummary(R.string.global_settings_registered_name_color_changed);
} else {
mChangeContactNameColor.setSummary(R.string.global_settings_registered_name_color_default);
}
mChangeContactNameColor.setChecked(checked);
return false;
}
});
mFixedWidth = (CheckBoxPreference)findPreference(PREFERENCE_MESSAGEVIEW_FIXEDWIDTH);
mFixedWidth.setChecked(K9.messageViewFixedWidthFont());
mReturnToList = (CheckBoxPreference) findPreference(PREFERENCE_MESSAGEVIEW_RETURN_TO_LIST);
mReturnToList.setChecked(K9.messageViewReturnToList());
mShowNext = (CheckBoxPreference) findPreference(PREFERENCE_MESSAGEVIEW_SHOW_NEXT);
mShowNext.setChecked(K9.messageViewShowNext());
mAutofitWidth = (CheckBoxPreference) findPreference(PREFERENCE_AUTOFIT_WIDTH);
mAutofitWidth.setChecked(K9.autofitWidth());
mQuietTimeEnabled = (CheckBoxPreference) findPreference(PREFERENCE_QUIET_TIME_ENABLED);
mQuietTimeEnabled.setChecked(K9.getQuietTimeEnabled());
mDisableNotificationDuringQuietTime = (CheckBoxPreference) findPreference(
PREFERENCE_DISABLE_NOTIFICATION_DURING_QUIET_TIME);
mDisableNotificationDuringQuietTime.setChecked(!K9.isNotificationDuringQuietTimeEnabled());
mQuietTimeStarts = (TimePickerPreference) findPreference(PREFERENCE_QUIET_TIME_STARTS);
mQuietTimeStarts.setDefaultValue(K9.getQuietTimeStarts());
mQuietTimeStarts.setSummary(K9.getQuietTimeStarts());
mQuietTimeStarts.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
public boolean onPreferenceChange(Preference preference, Object newValue) {
final String time = (String) newValue;
mQuietTimeStarts.setSummary(time);
return false;
}
});
mQuietTimeEnds = (TimePickerPreference) findPreference(PREFERENCE_QUIET_TIME_ENDS);
mQuietTimeEnds.setSummary(K9.getQuietTimeEnds());
mQuietTimeEnds.setDefaultValue(K9.getQuietTimeEnds());
mQuietTimeEnds.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
public boolean onPreferenceChange(Preference preference, Object newValue) {
final String time = (String) newValue;
mQuietTimeEnds.setSummary(time);
return false;
}
});
mNotificationQuickDelete = setupListPreference(PREFERENCE_NOTIF_QUICK_DELETE,
K9.getNotificationQuickDeleteBehaviour().toString());
if (!NotificationController.platformSupportsExtendedNotifications()) {
PreferenceScreen prefs = (PreferenceScreen) findPreference("notification_preferences");
prefs.removePreference(mNotificationQuickDelete);
mNotificationQuickDelete = null;
}
mLockScreenNotificationVisibility = setupListPreference(PREFERENCE_LOCK_SCREEN_NOTIFICATION_VISIBILITY,
K9.getLockScreenNotificationVisibility().toString());
if (!NotificationController.platformSupportsLockScreenNotifications()) {
((PreferenceScreen) findPreference("notification_preferences"))
.removePreference(mLockScreenNotificationVisibility);
mLockScreenNotificationVisibility = null;
}
mBackgroundOps = setupListPreference(PREFERENCE_BACKGROUND_OPS, K9.getBackgroundOps().name());
mDebugLogging = (CheckBoxPreference)findPreference(PREFERENCE_DEBUG_LOGGING);
mSensitiveLogging = (CheckBoxPreference)findPreference(PREFERENCE_SENSITIVE_LOGGING);
mHideUserAgent = (CheckBoxPreference)findPreference(PREFERENCE_HIDE_USERAGENT);
mHideTimeZone = (CheckBoxPreference)findPreference(PREFERENCE_HIDE_TIMEZONE);
mHideHostnameWhenConnecting = (CheckBoxPreference)findPreference(PREFERENCE_HIDE_HOSTNAME_WHEN_CONNECTING);
mDebugLogging.setChecked(K9.isDebug());
mSensitiveLogging.setChecked(K9.DEBUG_SENSITIVE);
mHideUserAgent.setChecked(K9.hideUserAgent());
mHideTimeZone.setChecked(K9.hideTimeZone());
mHideHostnameWhenConnecting.setChecked(K9.hideHostnameWhenConnecting());
mAttachmentPathPreference = findPreference(PREFERENCE_ATTACHMENT_DEF_PATH);
mAttachmentPathPreference.setSummary(K9.getAttachmentDefaultPath());
mAttachmentPathPreference
.setOnPreferenceClickListener(new OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
FileBrowserHelper
.getInstance()
.showFileBrowserActivity(Prefs.this,
new File(K9.getAttachmentDefaultPath()),
ACTIVITY_CHOOSE_FOLDER, callback);
return true;
}
FileBrowserFailOverCallback callback = new FileBrowserFailOverCallback() {
@Override
public void onPathEntered(String path) {
mAttachmentPathPreference.setSummary(path);
K9.setAttachmentDefaultPath(path);
}
@Override
public void onCancel() {
// canceled, do nothing
}
};
});
mWrapFolderNames = (CheckBoxPreference)findPreference(PREFERENCE_FOLDERLIST_WRAP_NAME);
mWrapFolderNames.setChecked(K9.wrapFolderNames());
mVisibleRefileActions = (CheckBoxListPreference) findPreference(PREFERENCE_MESSAGEVIEW_VISIBLE_REFILE_ACTIONS);
CharSequence[] visibleRefileActionsEntries = new CharSequence[5];
visibleRefileActionsEntries[VISIBLE_REFILE_ACTIONS_DELETE] = getString(R.string.delete_action);
visibleRefileActionsEntries[VISIBLE_REFILE_ACTIONS_ARCHIVE] = getString(R.string.archive_action);
visibleRefileActionsEntries[VISIBLE_REFILE_ACTIONS_MOVE] = getString(R.string.move_action);
visibleRefileActionsEntries[VISIBLE_REFILE_ACTIONS_COPY] = getString(R.string.copy_action);
visibleRefileActionsEntries[VISIBLE_REFILE_ACTIONS_SPAM] = getString(R.string.spam_action);
boolean[] visibleRefileActionsValues = new boolean[5];
visibleRefileActionsValues[VISIBLE_REFILE_ACTIONS_DELETE] = K9.isMessageViewDeleteActionVisible();
visibleRefileActionsValues[VISIBLE_REFILE_ACTIONS_ARCHIVE] = K9.isMessageViewArchiveActionVisible();
visibleRefileActionsValues[VISIBLE_REFILE_ACTIONS_MOVE] = K9.isMessageViewMoveActionVisible();
visibleRefileActionsValues[VISIBLE_REFILE_ACTIONS_COPY] = K9.isMessageViewCopyActionVisible();
visibleRefileActionsValues[VISIBLE_REFILE_ACTIONS_SPAM] = K9.isMessageViewSpamActionVisible();
mVisibleRefileActions.setItems(visibleRefileActionsEntries);
mVisibleRefileActions.setCheckedItems(visibleRefileActionsValues);
mSplitViewMode = (ListPreference) findPreference(PREFERENCE_SPLITVIEW_MODE);
initListPreference(mSplitViewMode, K9.getSplitViewMode().name(),
mSplitViewMode.getEntries(), mSplitViewMode.getEntryValues());
}
private static String themeIdToName(K9.Theme theme) {
switch (theme) {
case DARK: return "dark";
case USE_GLOBAL: return "global";
default: return "light";
}
}
private static K9.Theme themeNameToId(String theme) {
if (TextUtils.equals(theme, "dark")) {
return K9.Theme.DARK;
} else if (TextUtils.equals(theme, "global")) {
return K9.Theme.USE_GLOBAL;
} else {
return K9.Theme.LIGHT;
}
}
private void saveSettings() {
Storage storage = Preferences.getPreferences(this).getStorage();
K9.setK9Language(mLanguage.getValue());
K9.setK9Theme(themeNameToId(mTheme.getValue()));
K9.setUseFixedMessageViewTheme(mFixedMessageTheme.isChecked());
K9.setK9MessageViewThemeSetting(themeNameToId(mMessageTheme.getValue()));
K9.setK9ComposerThemeSetting(themeNameToId(mComposerTheme.getValue()));
K9.setAnimations(mAnimations.isChecked());
K9.setGesturesEnabled(mGestures.isChecked());
K9.setUseVolumeKeysForNavigation(mVolumeNavigation.getCheckedItems()[0]);
K9.setUseVolumeKeysForListNavigation(mVolumeNavigation.getCheckedItems()[1]);
K9.setStartIntegratedInbox(!mHideSpecialAccounts.isChecked() && mStartIntegratedInbox.isChecked());
K9.setNotificationHideSubject(NotificationHideSubject.valueOf(mNotificationHideSubject.getValue()));
int index = 0;
K9.setConfirmDelete(mConfirmActions.getCheckedItems()[index++]);
K9.setConfirmDeleteStarred(mConfirmActions.getCheckedItems()[index++]);
if (NotificationController.platformSupportsExtendedNotifications()) {
K9.setConfirmDeleteFromNotification(mConfirmActions.getCheckedItems()[index++]);
}
K9.setConfirmSpam(mConfirmActions.getCheckedItems()[index++]);
K9.setConfirmDiscardMessage(mConfirmActions.getCheckedItems()[index++]);
K9.setConfirmMarkAllRead(mConfirmActions.getCheckedItems()[index++]);
K9.setMeasureAccounts(mMeasureAccounts.isChecked());
K9.setCountSearchMessages(mCountSearch.isChecked());
K9.setHideSpecialAccounts(mHideSpecialAccounts.isChecked());
K9.setMessageListPreviewLines(Integer.parseInt(mPreviewLines.getValue()));
K9.setMessageListCheckboxes(mCheckboxes.isChecked());
K9.setMessageListStars(mStars.isChecked());
K9.setShowCorrespondentNames(mShowCorrespondentNames.isChecked());
K9.setMessageListSenderAboveSubject(mSenderAboveSubject.isChecked());
K9.setShowContactName(mShowContactName.isChecked());
K9.setShowContactPicture(mShowContactPicture.isChecked());
K9.setColorizeMissingContactPictures(mColorizeMissingContactPictures.isChecked());
K9.setUseBackgroundAsUnreadIndicator(mBackgroundAsUnreadIndicator.isChecked());
K9.setThreadedViewEnabled(mThreadedView.isChecked());
K9.setChangeContactNameColor(mChangeContactNameColor.isChecked());
K9.setMessageViewFixedWidthFont(mFixedWidth.isChecked());
K9.setMessageViewReturnToList(mReturnToList.isChecked());
K9.setMessageViewShowNext(mShowNext.isChecked());
K9.setAutofitWidth(mAutofitWidth.isChecked());
K9.setQuietTimeEnabled(mQuietTimeEnabled.isChecked());
boolean[] enabledRefileActions = mVisibleRefileActions.getCheckedItems();
K9.setMessageViewDeleteActionVisible(enabledRefileActions[VISIBLE_REFILE_ACTIONS_DELETE]);
K9.setMessageViewArchiveActionVisible(enabledRefileActions[VISIBLE_REFILE_ACTIONS_ARCHIVE]);
K9.setMessageViewMoveActionVisible(enabledRefileActions[VISIBLE_REFILE_ACTIONS_MOVE]);
K9.setMessageViewCopyActionVisible(enabledRefileActions[VISIBLE_REFILE_ACTIONS_COPY]);
K9.setMessageViewSpamActionVisible(enabledRefileActions[VISIBLE_REFILE_ACTIONS_SPAM]);
K9.setNotificationDuringQuietTimeEnabled(!mDisableNotificationDuringQuietTime.isChecked());
K9.setQuietTimeStarts(mQuietTimeStarts.getTime());
K9.setQuietTimeEnds(mQuietTimeEnds.getTime());
K9.setWrapFolderNames(mWrapFolderNames.isChecked());
if (mNotificationQuickDelete != null) {
K9.setNotificationQuickDeleteBehaviour(
NotificationQuickDelete.valueOf(mNotificationQuickDelete.getValue()));
}
if(mLockScreenNotificationVisibility != null) {
K9.setLockScreenNotificationVisibility(
K9.LockScreenNotificationVisibility.valueOf(mLockScreenNotificationVisibility.getValue()));
}
K9.setSplitViewMode(SplitViewMode.valueOf(mSplitViewMode.getValue()));
K9.setAttachmentDefaultPath(mAttachmentPathPreference.getSummary().toString());
boolean needsRefresh = K9.setBackgroundOps(mBackgroundOps.getValue());
if (!K9.isDebug() && mDebugLogging.isChecked()) {
Toast.makeText(this, R.string.debug_logging_enabled, Toast.LENGTH_LONG).show();
}
K9.setDebug(mDebugLogging.isChecked());
K9.DEBUG_SENSITIVE = mSensitiveLogging.isChecked();
K9.setHideUserAgent(mHideUserAgent.isChecked());
K9.setHideTimeZone(mHideTimeZone.isChecked());
K9.setHideHostnameWhenConnecting(mHideHostnameWhenConnecting.isChecked());
StorageEditor editor = storage.edit();
K9.save(editor);
editor.commit();
if (needsRefresh) {
MailService.actionReset(this, null);
}
}
@Override
protected void onPause() {
saveSettings();
super.onPause();
}
private void onFontSizeSettings() {
FontSizeSettings.actionEditSettings(this);
}
private void onChooseContactNameColor() {
new ColorPickerDialog(this, new ColorPickerDialog.OnColorChangedListener() {
public void colorChanged(int color) {
K9.setContactNameColor(color);
}
},
K9.getContactNameColor()).show();
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
case ACTIVITY_CHOOSE_FOLDER:
if (resultCode == RESULT_OK && data != null) {
// obtain the filename
Uri fileUri = data.getData();
if (fileUri != null) {
String filePath = fileUri.getPath();
if (filePath != null) {
mAttachmentPathPreference.setSummary(filePath.toString());
K9.setAttachmentDefaultPath(filePath.toString());
}
}
}
break;
}
super.onActivityResult(requestCode, resultCode, data);
}
}

View file

@ -0,0 +1,9 @@
package com.fsck.k9.helper
import java.util.concurrent.ThreadFactory
class NamedThreadFactory(private val threadNamePrefix: String) : ThreadFactory {
var counter: Int = 0
override fun newThread(runnable: Runnable) = Thread(runnable, "$threadNamePrefix-${ counter++ }")
}

View file

@ -1,64 +0,0 @@
package com.fsck.k9.preferences;
import android.app.AlertDialog.Builder;
import android.content.Context;
import android.content.DialogInterface;
import android.preference.DialogPreference;
import android.util.AttributeSet;
public class CheckBoxListPreference extends DialogPreference {
private CharSequence[] mItems;
private boolean[] mCheckedItems;
/**
* checkboxes state when the dialog is displayed
*/
private boolean[] mPendingItems;
public CheckBoxListPreference(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
public CheckBoxListPreference(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
protected void onPrepareDialogBuilder(final Builder builder) {
mPendingItems = new boolean[mItems.length];
System.arraycopy(mCheckedItems, 0, mPendingItems, 0, mCheckedItems.length);
builder.setMultiChoiceItems(mItems, mPendingItems,
new DialogInterface.OnMultiChoiceClickListener() {
@Override
public void onClick(final DialogInterface dialog, final int which,
final boolean isChecked) {
mPendingItems[which] = isChecked;
}
});
}
@Override
protected void onDialogClosed(boolean positiveResult) {
if (positiveResult) {
System.arraycopy(mPendingItems, 0, mCheckedItems, 0, mPendingItems.length);
}
mPendingItems = null;
}
public void setItems(final CharSequence[] items) {
mItems = items;
}
public void setCheckedItems(final boolean[] items) {
mCheckedItems = items;
}
public boolean[] getCheckedItems() {
return mCheckedItems;
}
}

View file

@ -30,7 +30,6 @@ import com.fsck.k9.preferences.Settings.InvalidSettingValueException;
import com.fsck.k9.preferences.Settings.PseudoEnumSetting;
import com.fsck.k9.preferences.Settings.SettingsDescription;
import com.fsck.k9.preferences.Settings.SettingsUpgrader;
import com.fsck.k9.preferences.Settings.StringSetting;
import com.fsck.k9.preferences.Settings.V;
import com.fsck.k9.preferences.Settings.WebFontSizeSetting;
@ -423,7 +422,7 @@ public class GlobalSettings {
super("");
Map<String, String> mapping = new HashMap<>();
String[] values = K9.app.getResources().getStringArray(R.array.settings_language_values);
String[] values = K9.app.getResources().getStringArray(R.array.language_values);
for (String value : values) {
if (value.length() == 0) {
mapping.put("", "default");
@ -545,13 +544,15 @@ public class GlobalSettings {
}
private static class TimeSetting extends SettingsDescription<String> {
private static final String VALIDATION_EXPRESSION = "[0-2]*[0-9]:[0-5]*[0-9]";
TimeSetting(String defaultValue) {
super(defaultValue);
}
@Override
public String fromString(String value) throws InvalidSettingValueException {
if (!value.matches(TimePickerPreference.VALIDATION_EXPRESSION)) {
if (!value.matches(VALIDATION_EXPRESSION)) {
throw new InvalidSettingValueException();
}
return value;

View file

@ -1,176 +0,0 @@
/* Sourced from http://www.ebessette.com/d/TimePickerPreference
* on 2010-11-27 by jessev
*/
package com.fsck.k9.preferences;
import java.util.Locale;
import android.content.Context;
import android.preference.DialogPreference;
import android.text.format.DateFormat;
import android.util.AttributeSet;
import android.view.View;
import android.widget.TimePicker;
/**
* A preference type that allows a user to choose a time
*/
public class TimePickerPreference extends DialogPreference implements
TimePicker.OnTimeChangedListener {
/**
* The validation expression for this preference
*/
public static final String VALIDATION_EXPRESSION = "[0-2]*[0-9]:[0-5]*[0-9]";
/**
* The default value for this preference
*/
private String defaultValue;
/**
* Store the original value, in case the user
* chooses to abort the {@link DialogPreference}
* after making a change.
*/
private int originalHour = 0;
/**
* Store the original value, in case the user
* chooses to abort the {@link DialogPreference}
* after making a change.
*/
private int originalMinute = 0;
/**
* @param context
* @param attrs
*/
public TimePickerPreference(final Context context, final AttributeSet attrs) {
super(context, attrs);
initialize();
}
/**
* @param context
* @param attrs
* @param defStyle
*/
public TimePickerPreference(final Context context, final AttributeSet attrs,
final int defStyle) {
super(context, attrs, defStyle);
initialize();
}
/**
* Initialize this preference
*/
private void initialize() {
setPersistent(true);
}
/*
* (non-Javadoc)
*
* @see android.preference.DialogPreference#onCreateDialogView()
*/
@Override
protected View onCreateDialogView() {
TimePicker tp = new TimePicker(getContext());
tp.setIs24HourView(DateFormat.is24HourFormat(getContext()));
tp.setOnTimeChangedListener(this);
originalHour = getHour();
originalMinute = getMinute();
if (originalHour >= 0 && originalMinute >= 0) {
tp.setCurrentHour(originalHour);
tp.setCurrentMinute(originalMinute);
}
return tp;
}
/**
* @see
* android.widget.TimePicker.OnTimeChangedListener#onTimeChanged(android
* .widget.TimePicker, int, int)
*/
@Override
public void onTimeChanged(final TimePicker view, final int hour, final int minute) {
persistString(String.format(Locale.US, "%02d:%02d", hour, minute));
callChangeListener(String.format(Locale.US, "%02d:%02d", hour, minute));
}
/**
* If not a positive result, restore the original value
* before going to super.onDialogClosed(positiveResult).
*/
@Override
protected void onDialogClosed(boolean positiveResult) {
if (!positiveResult) {
persistString(String.format(Locale.US, "%02d:%02d", originalHour, originalMinute));
callChangeListener(String.format(Locale.US, "%02d:%02d", originalHour, originalMinute));
}
super.onDialogClosed(positiveResult);
}
/**
* @see android.preference.Preference#setDefaultValue(java.lang.Object)
*/
@Override
public void setDefaultValue(final Object defaultValue) {
// BUG this method is never called if you use the 'android:defaultValue' attribute in your XML preference file, not sure why it isn't
super.setDefaultValue(defaultValue);
if (!(defaultValue instanceof String)) {
return;
}
if (!((String) defaultValue).matches(VALIDATION_EXPRESSION)) {
return;
}
this.defaultValue = (String) defaultValue;
}
/**
* Get the hour value (in 24 hour time)
*
* @return The hour value, will be 0 to 23 (inclusive) or -1 if illegal
*/
private int getHour() {
String time = getTime();
if (time == null || !time.matches(VALIDATION_EXPRESSION)) {
return -1;
}
return Integer.parseInt(time.split(":")[0]);
}
/**
* Get the minute value
*
* @return the minute value, will be 0 to 59 (inclusive) or -1 if illegal
*/
private int getMinute() {
String time = getTime();
if (time == null || !time.matches(VALIDATION_EXPRESSION)) {
return -1;
}
return Integer.parseInt(time.split(":")[1]);
}
/**
* Get the time. It is only legal, if it matches
* {@link #VALIDATION_EXPRESSION}.
*
* @return the time as hh:mm
*/
public String getTime() {
return getPersistedString(this.defaultValue);
}
}

View file

@ -0,0 +1,27 @@
package com.fsck.k9.ui
import android.support.v4.app.Fragment
import android.support.v4.app.FragmentActivity
import android.support.v4.app.FragmentTransaction
import androidx.core.os.bundleOf
inline fun FragmentActivity.fragmentTransaction(crossinline block: FragmentTransaction.() -> Unit) {
with(supportFragmentManager.beginTransaction()) {
block()
commit()
}
}
inline fun FragmentActivity.fragmentTransactionWithBackStack(
name: String? = null,
crossinline block: FragmentTransaction.() -> Unit
) {
fragmentTransaction {
block()
addToBackStack(name)
}
}
fun Fragment.withArguments(vararg argumentPairs: Pair<String, Any?>) = apply {
arguments = bundleOf(*argumentPairs)
}

View file

@ -104,6 +104,7 @@ class AboutActivity : K9Activity() {
companion object {
private val USED_LIBRARIES = mapOf(
"Android Support Library" to "https://developer.android.com/topic/libraries/support-library/index.html",
"Android-Support-Preference-V7-Fix" to "https://github.com/Gericop/Android-Support-Preference-V7-Fix",
"ckChangeLog" to "https://github.com/cketti/ckChangeLog",
"Commons IO" to "http://commons.apache.org/io/",
"Glide" to "https://github.com/bumptech/glide",

View file

@ -1,10 +1,19 @@
package com.fsck.k9.ui.settings
import com.fsck.k9.helper.FileBrowserHelper
import com.fsck.k9.helper.NamedThreadFactory
import com.fsck.k9.ui.account.AccountsLiveData
import com.fsck.k9.ui.settings.general.GeneralSettingsDataStore
import org.koin.android.architecture.ext.viewModel
import org.koin.dsl.module.applicationContext
import java.util.concurrent.Executors
val settingsUiModule = applicationContext {
bean { AccountsLiveData(get()) }
viewModel { SettingsViewModel(get()) }
bean { FileBrowserHelper.getInstance() }
bean { GeneralSettingsDataStore(get(), get(), get("GeneralSettingsExecutor")) }
bean("GeneralSettingsExecutor") {
Executors.newSingleThreadExecutor(NamedThreadFactory("GeneralSettingsDataStore"))
}
}

View file

@ -0,0 +1,11 @@
package com.fsck.k9.ui.settings
import android.support.v7.preference.Preference
inline fun Preference.onClick(crossinline action: () -> Unit) = setOnPreferenceClickListener {
action()
true
}
fun Preference.remove() = parent?.removePreference(this)

View file

@ -2,12 +2,12 @@ package com.fsck.k9.ui.settings
import android.app.Activity
import com.fsck.k9.activity.setup.AccountSetupBasics
import com.fsck.k9.activity.setup.Prefs
import com.fsck.k9.ui.settings.general.GeneralSettingsActivity
internal enum class SettingsAction {
GENERAL_SETTINGS {
override fun execute(activity: Activity) {
Prefs.actionPrefs(activity)
GeneralSettingsActivity.start(activity)
}
},
ADD_ACCOUNT {

View file

@ -0,0 +1,61 @@
package com.fsck.k9.ui.settings.general
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.support.v7.preference.PreferenceFragmentCompat
import android.support.v7.preference.PreferenceFragmentCompat.OnPreferenceStartScreenCallback
import android.support.v7.preference.PreferenceScreen
import android.view.MenuItem
import com.fsck.k9.R
import com.fsck.k9.activity.K9Activity
import com.fsck.k9.ui.fragmentTransaction
import com.fsck.k9.ui.fragmentTransactionWithBackStack
class GeneralSettingsActivity : K9Activity(), OnPreferenceStartScreenCallback {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.general_settings)
initializeActionBar()
if (savedInstanceState == null) {
fragmentTransaction {
add(R.id.generalSettingsContainer, GeneralSettingsFragment.create())
}
}
}
private fun initializeActionBar() {
val actionBar = supportActionBar ?: throw RuntimeException("getSupportActionBar() == null")
actionBar.setDisplayHomeAsUpEnabled(true)
}
override fun onOptionsItemSelected(item: MenuItem): Boolean {
if (item.itemId == android.R.id.home) {
onBackPressed()
return true
}
return super.onOptionsItemSelected(item)
}
override fun onPreferenceStartScreen(
caller: PreferenceFragmentCompat, preferenceScreen: PreferenceScreen
): Boolean {
fragmentTransactionWithBackStack {
replace(R.id.generalSettingsContainer, GeneralSettingsFragment.create(preferenceScreen.key))
}
return true
}
companion object {
fun start(context: Context) {
val intent = Intent(context, GeneralSettingsActivity::class.java)
context.startActivity(intent)
}
}
}

View file

@ -0,0 +1,257 @@
package com.fsck.k9.ui.settings.general
import android.content.Context
import android.support.v4.app.FragmentActivity
import android.support.v7.preference.PreferenceDataStore
import com.fsck.k9.K9
import com.fsck.k9.K9.Theme
import com.fsck.k9.Preferences
import com.fsck.k9.service.MailService
import java.util.concurrent.ExecutorService
class GeneralSettingsDataStore(
private val context: Context,
private val preferences: Preferences,
private val executorService: ExecutorService
) : PreferenceDataStore() {
var activity: FragmentActivity? = null
override fun getBoolean(key: String, defValue: Boolean): Boolean {
return when (key) {
"fixed_message_view_theme" -> K9.useFixedMessageViewTheme()
"animations" -> K9.showAnimations()
"measure_accounts" -> K9.measureAccounts()
"count_search" -> K9.countSearchMessages()
"hide_special_accounts" -> K9.isHideSpecialAccounts()
"folderlist_wrap_folder_name" -> K9.wrapFolderNames()
"messagelist_stars" -> K9.messageListStars()
"messagelist_checkboxes" -> K9.messageListCheckboxes()
"messagelist_show_correspondent_names" -> K9.showCorrespondentNames()
"messagelist_sender_above_subject" -> K9.messageListSenderAboveSubject()
"messagelist_show_contact_name" -> K9.showContactName()
"messagelist_change_contact_name_color" -> K9.changeContactNameColor()
"messagelist_show_contact_picture" -> K9.showContactPicture()
"messagelist_colorize_missing_contact_pictures" -> K9.isColorizeMissingContactPictures()
"messagelist_background_as_unread_indicator" -> K9.useBackgroundAsUnreadIndicator()
"threaded_view" -> K9.isThreadedViewEnabled()
"messageview_fixedwidth_font" -> K9.messageViewFixedWidthFont()
"messageview_autofit_width" -> K9.autofitWidth()
"start_integrated_inbox" -> K9.startIntegratedInbox()
"gestures" -> K9.gesturesEnabled()
"messageview_return_to_list" -> K9.messageViewReturnToList()
"messageview_show_next" -> K9.messageViewShowNext()
"quiet_time_enabled" -> K9.getQuietTimeEnabled()
"disable_notifications_during_quiet_time" -> K9.isNotificationDuringQuietTimeEnabled()
"privacy_hide_useragent" -> K9.hideUserAgent()
"privacy_hide_timezone" -> K9.hideTimeZone()
"privacy_hide_hostname_when_connecting" -> K9.hideHostnameWhenConnecting()
"debug_logging" -> K9.isDebug()
"sensitive_logging" -> K9.DEBUG_SENSITIVE
else -> defValue
}
}
override fun putBoolean(key: String, value: Boolean) {
when (key) {
"fixed_message_view_theme" -> K9.setUseFixedMessageViewTheme(value)
"animations" -> K9.setAnimations(value)
"measure_accounts" -> K9.setMeasureAccounts(value)
"count_search" -> K9.setCountSearchMessages(value)
"hide_special_accounts" -> K9.setHideSpecialAccounts(value)
"folderlist_wrap_folder_name" -> K9.setWrapFolderNames(value)
"messagelist_stars" -> K9.setMessageListStars(value)
"messagelist_checkboxes" -> K9.setMessageListCheckboxes(value)
"messagelist_show_correspondent_names" -> K9.setShowCorrespondentNames(value)
"messagelist_sender_above_subject" -> K9.setMessageListSenderAboveSubject(value)
"messagelist_show_contact_name" -> K9.setShowContactName(value)
"messagelist_change_contact_name_color" -> K9.setChangeContactNameColor(value)
"messagelist_show_contact_picture" -> K9.setShowContactPicture(value)
"messagelist_colorize_missing_contact_pictures" -> K9.setColorizeMissingContactPictures(value)
"messagelist_background_as_unread_indicator" -> K9.setUseBackgroundAsUnreadIndicator(value)
"threaded_view" -> K9.setThreadedViewEnabled(value)
"messageview_fixedwidth_font" -> K9.setMessageViewFixedWidthFont(value)
"messageview_autofit_width" -> K9.setAutofitWidth(value)
"start_integrated_inbox" -> K9.setStartIntegratedInbox(value)
"gestures" -> K9.setGesturesEnabled(value)
"messageview_return_to_list" -> K9.setMessageViewReturnToList(value)
"messageview_show_next" -> K9.setMessageViewShowNext(value)
"quiet_time_enabled" -> K9.setQuietTimeEnabled(value)
"disable_notifications_during_quiet_time" -> K9.setNotificationDuringQuietTimeEnabled(value)
"privacy_hide_useragent" -> K9.setHideUserAgent(value)
"privacy_hide_timezone" -> K9.setHideTimeZone(value)
"privacy_hide_hostname_when_connecting" -> K9.hideHostnameWhenConnecting()
"debug_logging" -> K9.setDebug(value)
"sensitive_logging" -> K9.DEBUG_SENSITIVE = value
else -> return
}
saveSettings()
}
override fun getInt(key: String?, defValue: Int): Int {
return when (key) {
"messagelist_contact_name_color" -> K9.getContactNameColor()
else -> defValue
}
}
override fun putInt(key: String?, value: Int) {
when (key) {
"messagelist_contact_name_color" -> K9.setContactNameColor(value)
else -> return
}
saveSettings()
}
override fun getString(key: String, defValue: String?): String? {
return when (key) {
"language" -> K9.getK9Language()
"theme" -> themeToString(K9.getK9Theme())
"fixed_message_view_theme" -> themeToString(K9.getK9MessageViewThemeSetting())
"message_compose_theme" -> themeToString(K9.getK9ComposerThemeSetting())
"messageViewTheme" -> themeToString(K9.getK9MessageViewThemeSetting())
"messagelist_preview_lines" -> K9.messageListPreviewLines().toString()
"splitview_mode" -> K9.getSplitViewMode().name
"notification_quick_delete" -> K9.getNotificationQuickDeleteBehaviour().name
"lock_screen_notification_visibility" -> K9.getLockScreenNotificationVisibility().name
"background_ops" -> K9.getBackgroundOps().name
"notification_hide_subject" -> K9.getNotificationHideSubject().name
"attachment_default_path" -> K9.getAttachmentDefaultPath()
"quiet_time_starts" -> K9.getQuietTimeStarts()
"quiet_time_ends" -> K9.getQuietTimeEnds()
else -> defValue
}
}
override fun putString(key: String, value: String?) {
if (value == null) return
when (key) {
"language" -> setLanguage(value)
"theme" -> setTheme(value)
"fixed_message_view_theme" -> K9.setK9MessageViewThemeSetting(stringToTheme(value))
"message_compose_theme" -> K9.setK9ComposerThemeSetting(stringToTheme(value))
"messageViewTheme" -> K9.setK9MessageViewThemeSetting(stringToTheme(value))
"messagelist_preview_lines" -> K9.setMessageListPreviewLines(value.toInt())
"splitview_mode" -> K9.setSplitViewMode(K9.SplitViewMode.valueOf(value))
"notification_quick_delete" -> K9.setNotificationQuickDeleteBehaviour(K9.NotificationQuickDelete.valueOf(value))
"lock_screen_notification_visibility" -> K9.setLockScreenNotificationVisibility(K9.LockScreenNotificationVisibility.valueOf(value))
"background_ops" -> setBackgroundOps(value)
"notification_hide_subject" -> K9.setNotificationHideSubject(K9.NotificationHideSubject.valueOf(value))
"attachment_default_path" -> K9.setAttachmentDefaultPath(value)
"quiet_time_starts" -> K9.setQuietTimeStarts(value)
"quiet_time_ends" -> K9.setQuietTimeEnds(value)
else -> return
}
saveSettings()
}
override fun getStringSet(key: String, defValues: Set<String>?): Set<String>? {
return when (key) {
"confirm_actions" -> {
mutableSetOf<String>().apply {
if (K9.confirmDelete()) add("delete")
if (K9.confirmDeleteStarred()) add("delete_starred")
if (K9.confirmDeleteFromNotification()) add("delete_notif")
if (K9.confirmSpam()) add("spam")
if (K9.confirmDiscardMessage()) add("discard")
if (K9.confirmMarkAllRead()) add("mark_all_read")
}
}
"messageview_visible_refile_actions" -> {
mutableSetOf<String>().apply {
if (K9.isMessageViewDeleteActionVisible()) add("delete")
if (K9.isMessageViewArchiveActionVisible()) add("archive")
if (K9.isMessageViewMoveActionVisible()) add("move")
if (K9.isMessageViewCopyActionVisible()) add("copy")
if (K9.isMessageViewSpamActionVisible()) add("spam")
}
}
"volume_navigation" -> {
mutableSetOf<String>().apply {
if (K9.useVolumeKeysForNavigationEnabled()) add("message")
if (K9.useVolumeKeysForListNavigationEnabled()) add("list")
}
}
else -> defValues
}
}
override fun putStringSet(key: String, values: MutableSet<String>?) {
val checkedValues = values ?: emptySet<String>()
when (key) {
"confirm_actions" -> {
K9.setConfirmDelete("delete" in checkedValues)
K9.setConfirmDeleteStarred("delete_starred" in checkedValues)
K9.setConfirmDeleteFromNotification("delete_notif" in checkedValues)
K9.setConfirmSpam("spam" in checkedValues)
K9.setConfirmDiscardMessage("discard" in checkedValues)
K9.setConfirmMarkAllRead("mark_all_read" in checkedValues)
}
"messageview_visible_refile_actions" -> {
K9.setMessageViewDeleteActionVisible("delete" in checkedValues)
K9.setMessageViewArchiveActionVisible("archive" in checkedValues)
K9.setMessageViewMoveActionVisible("move" in checkedValues)
K9.setMessageViewCopyActionVisible("copy" in checkedValues)
K9.setMessageViewSpamActionVisible("spam" in checkedValues)
}
"volume_navigation" -> {
K9.setUseVolumeKeysForNavigation("message" in checkedValues)
K9.setUseVolumeKeysForListNavigation("list" in checkedValues)
}
else -> return
}
saveSettings()
}
private fun saveSettings() {
val editor = preferences.storage.edit()
K9.save(editor)
executorService.execute {
editor.commit()
}
}
private fun setTheme(value: String?) {
K9.setK9Theme(stringToTheme(value))
recreateActivity()
}
private fun setLanguage(language: String?) {
K9.setK9Language(language)
recreateActivity()
}
private fun themeToString(theme: Theme) = when (theme) {
Theme.LIGHT -> "light"
Theme.DARK -> "dark"
Theme.USE_GLOBAL -> "global"
}
private fun stringToTheme(theme: String?) = when (theme) {
"light" -> Theme.LIGHT
"dark" -> Theme.DARK
"global" -> Theme.USE_GLOBAL
else -> throw AssertionError()
}
private fun setBackgroundOps(value: String) {
val newBackgroundOps = K9.BACKGROUND_OPS.valueOf(value)
if (newBackgroundOps != K9.getBackgroundOps()) {
K9.setBackgroundOps(value)
resetMailService()
}
}
private fun resetMailService() {
MailService.actionReset(context, null)
}
private fun recreateActivity() {
activity?.recreate()
}
}

View file

@ -0,0 +1,127 @@
package com.fsck.k9.ui.settings.general
import android.app.Activity
import android.content.Intent
import android.os.Bundle
import android.support.v14.preference.MultiSelectListPreference
import android.support.v7.preference.Preference
import com.fsck.k9.R
import com.fsck.k9.helper.FileBrowserHelper
import com.fsck.k9.notification.NotificationController
import com.fsck.k9.ui.settings.onClick
import com.fsck.k9.ui.settings.remove
import com.fsck.k9.ui.withArguments
import com.takisoft.fix.support.v7.preference.PreferenceFragmentCompat
import org.koin.android.ext.android.inject
import java.io.File
class GeneralSettingsFragment : PreferenceFragmentCompat() {
private val dataStore: GeneralSettingsDataStore by inject()
private val fileBrowserHelper: FileBrowserHelper by inject()
private lateinit var attachmentDefaultPathPreference: Preference
override fun onCreatePreferencesFix(savedInstanceState: Bundle?, rootKey: String?) {
preferenceManager.preferenceDataStore = dataStore
setPreferencesFromResource(R.xml.general_settings, rootKey)
initializeAttachmentDefaultPathPreference()
initializeStartInUnifiedInbox()
initializeConfirmActions()
initializeLockScreenNotificationVisibility()
initializeNotificationQuickDelete()
}
override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)
activity?.title = preferenceScreen.title
dataStore.activity = activity
}
private fun initializeAttachmentDefaultPathPreference() {
findPreference(PREFERENCE_ATTACHMENT_DEFAULT_PATH)?.apply {
attachmentDefaultPathPreference = this
summary = attachmentDefaultPath()
onClick {
fileBrowserHelper.showFileBrowserActivity(this@GeneralSettingsFragment,
File(attachmentDefaultPath()), REQUEST_PICK_DIRECTORY,
object : FileBrowserHelper.FileBrowserFailOverCallback {
override fun onPathEntered(path: String) {
setAttachmentDefaultPath(path)
}
override fun onCancel() = Unit
}
)
}
}
}
private fun initializeStartInUnifiedInbox() {
findPreference(PREFERENCE_START_IN_UNIFIED_INBOX)?.apply {
if (hideSpecialAccounts()) {
isEnabled = false
}
}
}
private fun initializeConfirmActions() {
val notificationActionsSupported = NotificationController.platformSupportsExtendedNotifications()
if (!notificationActionsSupported) {
(findPreference(PREFERENCE_CONFIRM_ACTIONS) as? MultiSelectListPreference)?.apply {
val deleteIndex = entryValues.indexOf(CONFIRM_ACTION_DELETE_FROM_NOTIFICATION)
entries = entries.filterIndexed { index, _ -> index != deleteIndex }.toTypedArray()
entryValues = entryValues.filterIndexed { index, _ -> index != deleteIndex }.toTypedArray()
}
}
}
private fun initializeLockScreenNotificationVisibility() {
val lockScreenNotificationsSupported = NotificationController.platformSupportsLockScreenNotifications()
if (!lockScreenNotificationsSupported) {
findPreference(PREFERENCE_LOCK_SCREEN_NOTIFICATION_VISIBILITY)?.apply { remove() }
}
}
private fun initializeNotificationQuickDelete() {
val notificationActionsSupported = NotificationController.platformSupportsExtendedNotifications()
if (!notificationActionsSupported) {
findPreference(PREFERENCE_NOTIFICATION_QUICK_DELETE)?.apply { remove() }
}
}
override fun onActivityResult(requestCode: Int, resultCode: Int, result: Intent?) {
if (requestCode == REQUEST_PICK_DIRECTORY && resultCode == Activity.RESULT_OK && result != null) {
result.data?.path?.let {
setAttachmentDefaultPath(it)
}
}
}
private fun attachmentDefaultPath() = dataStore.getString(PREFERENCE_ATTACHMENT_DEFAULT_PATH, "")
private fun setAttachmentDefaultPath(path: String) {
attachmentDefaultPathPreference.summary = path
dataStore.putString(PREFERENCE_ATTACHMENT_DEFAULT_PATH, path)
}
private fun hideSpecialAccounts() = dataStore.getBoolean(PREFERENCE_HIDE_SPECIAL_ACCOUNTS, false)
companion object {
private const val REQUEST_PICK_DIRECTORY = 1
private const val PREFERENCE_ATTACHMENT_DEFAULT_PATH = "attachment_default_path"
private const val PREFERENCE_START_IN_UNIFIED_INBOX = "start_integrated_inbox"
private const val PREFERENCE_HIDE_SPECIAL_ACCOUNTS = "hide_special_accounts"
private const val PREFERENCE_CONFIRM_ACTIONS = "confirm_actions"
private const val PREFERENCE_LOCK_SCREEN_NOTIFICATION_VISIBILITY = "lock_screen_notification_visibility"
private const val PREFERENCE_NOTIFICATION_QUICK_DELETE = "notification_quick_delete"
private const val CONFIRM_ACTION_DELETE_FROM_NOTIFICATION = "delete_notif"
fun create(rootKey: String? = null) = GeneralSettingsFragment().withArguments(
PreferenceFragmentCompat.ARG_PREFERENCE_ROOT to rootKey)
}
}

View file

@ -0,0 +1,39 @@
package com.fsck.k9.ui.settings.general
import android.annotation.SuppressLint
import android.content.Context
import android.support.v4.content.res.TypedArrayUtils
import android.support.v7.preference.ListPreference
import android.util.AttributeSet
import com.fsck.k9.R
class LanguagePreference
@JvmOverloads
@SuppressLint("RestrictedApi")
constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = TypedArrayUtils.getAttr(context,
android.support.v7.preference.R.attr.dialogPreferenceStyle,
android.R.attr.dialogPreferenceStyle),
defStyleRes: Int = 0
) : ListPreference(context, attrs, defStyleAttr, defStyleRes ) {
init {
val supportedLanguages = context.resources.getStringArray(R.array.supported_languages).toSet()
val newEntries = mutableListOf<CharSequence>()
val newEntryValues = mutableListOf<CharSequence>()
entryValues.forEachIndexed { index, language ->
if (language in supportedLanguages) {
newEntries.add(entries[index])
newEntryValues.add(entryValues[index])
}
}
entries = newEntries.toTypedArray()
entryValues = newEntryValues.toTypedArray()
}
}

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/generalSettingsContainer"
android:layout_width="match_parent"
android:layout_height="match_parent" />

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="application_id" translatable="false">com.fsck.k9</string>
</resources>

View file

@ -341,254 +341,6 @@
<item>EXPUNGE_MANUALLY</item>
</string-array>
<string-array name="settings_language_entries">
<item>@string/setting_language_system</item>
<item>Afrikaans</item>
<item>Azərbaycan</item>
<item>Bahasa indonesia</item>
<item>Bahasa melayu</item>
<item>Bamanankan</item>
<item>Brezhoneg</item>
<item>Català</item>
<item>Čeština</item>
<item>Cymraeg</item>
<item>Dansk</item>
<item>Deutsch</item>
<item>Eesti</item>
<item>English</item>
<item>Español</item>
<item>Esperanto</item>
<item>Euskera</item>
<item>Ɛʋɛ</item>
<item>Français</item>
<item>Français (Canada)</item>
<item>Fulfulde, Pulaar, Pular</item>
<item>Gaeilge</item>
<item>Gàidhlig</item>
<item>Galego</item>
<item>Hausa</item>
<item>Hrvatski</item>
<item>isiXhosa</item>
<item>isiZulu</item>
<item>Íslenska</item>
<item>Italiano</item>
<item>Kinyarwanda</item>
<item>Kirundi</item>
<item>Kiswahili</item>
<item>Latviešu</item>
<item>Lietuvių</item>
<item>Magyar</item>
<item>Malti</item>
<item>Nederlands</item>
<item>Norsk</item>
<item>Norsk Bokmål</item>
<item>O\'zbek</item>
<item>Polski</item>
<item>Português</item>
<item>Português (Brasil)</item>
<item>Pyccĸий</item>
<item>Română</item>
<item>Shqip</item>
<item>Slovenčina</item>
<item>Slovenščina</item>
<item>Somali</item>
<item>Suomi</item>
<item>Svenska</item>
<item>Tiếng Việt</item>
<item>Tϋrkçe</item>
<item>Wolof</item>
<item>Yorùbá</item>
<item>Ελληνικά</item>
<item>аҧсуа бызшәа</item>
<item>Беларуская</item>
<item>Български</item>
<item>Кыргыз</item>
<item>Қазақ</item>
<item>Македонски</item>
<item>Српски</item>
<item>Українська</item>
<item>Հայերեն</item>
<item>עברית</item>
<item>اردو</item>
<item>العربية</item>
<item>پښتو</item>
<item>فارسی</item>
<item>አማርኛ</item>
<item>हिंदी</item>
<item>తెలుగు</item>
<item>ಕನ್ನಡ</item>
<item>ภาษาไทย</item>
<item>한국어</item>
<item>中文(简体)</item>
<item>中文(繁體)</item>
<item>日本語</item>
</string-array>
<string-array name="settings_language_values" translatable="false">
<item></item>
<item>af</item>
<item>az</item>
<item>in</item>
<item>ms</item>
<item>bm</item>
<item>br</item>
<item>ca</item>
<item>cs</item>
<item>cy</item>
<item>da</item>
<item>de</item>
<item>et</item>
<item>en</item>
<item>es</item>
<item>eo</item>
<item>eu</item>
<item>ee</item>
<item>fr</item>
<item>fr_CA</item>
<item>ff</item>
<item>ga</item>
<item>gd</item>
<item>gl</item>
<item>ha</item>
<item>hr</item>
<item>xs</item>
<item>zu</item>
<item>is</item>
<item>it</item>
<item>rw</item>
<item>rn</item>
<item>sw</item>
<item>lv</item>
<item>lt</item>
<item>hu</item>
<item>mt</item>
<item>nl</item>
<item>no</item>
<item>nb</item>
<item>uz</item>
<item>pl</item>
<item>pt_PT</item>
<item>pt_BR</item>
<item>ru</item>
<item>ro</item>
<item>sq</item>
<item>sk</item>
<item>sl</item>
<item>so</item>
<item>fi</item>
<item>sv</item>
<item>vi</item>
<item>tr</item>
<item>wo</item>
<item>yo</item>
<item>el</item>
<item>ab</item>
<item>be</item>
<item>bg</item>
<item>ky</item>
<item>kk</item>
<item>mk</item>
<item>sr</item>
<item>uk</item>
<item>hy</item>
<item>iw</item>
<item>ur</item>
<item>ar</item>
<item>ps</item>
<item>fa</item>
<item>am</item>
<item>hi</item>
<item>te</item>
<item>kn</item>
<item>th</item>
<item>ko</item>
<item>zh_CN</item>
<item>zh_TW</item>
<item>ja</item>
</string-array>
<string-array name="supported_languages" translatable="false">
<item></item>
<item>in</item>
<item>br</item>
<item>ca</item>
<item>cs</item>
<item>cy</item>
<item>da</item>
<item>de</item>
<item>et</item>
<item>en</item>
<item>es</item>
<item>eo</item>
<item>eu</item>
<item>fr</item>
<item>gd</item>
<item>gl</item>
<item>hr</item>
<item>is</item>
<item>it</item>
<item>lv</item>
<item>lt</item>
<item>hu</item>
<item>nl</item>
<item>nb</item>
<item>pl</item>
<item>pt_PT</item>
<item>pt_BR</item>
<item>ru</item>
<item>ro</item>
<item>sq</item>
<item>sk</item>
<item>sl</item>
<item>fi</item>
<item>sv</item>
<item>tr</item>
<item>el</item>
<item>bg</item>
<item>sr</item>
<item>uk</item>
<item>iw</item>
<item>fa</item>
<item>ko</item>
<item>zh_CN</item>
<item>zh_TW</item>
<item>ja</item>
</string-array>
<string-array name="settings_theme_entries">
<item>@string/setting_theme_light</item>
<item>@string/setting_theme_dark</item>
</string-array>
<string-array name="settings_theme_values" translatable="false">
<item>light</item>
<item>dark</item>
</string-array>
<string-array name="settings_message_theme_entries">
<item>@string/setting_theme_light</item>
<item>@string/setting_theme_dark</item>
<item>@string/setting_theme_global</item>
</string-array>
<string-array name="settings_message_theme_values" translatable="false">
<item>light</item>
<item>dark</item>
<item>global</item>
</string-array>
<string-array name="background_ops_entries">
<item>@string/background_ops_auto_sync_only</item>
<item>@string/background_ops_always</item>
<item>@string/background_ops_never</item>
</string-array>
<string-array name="background_ops_values" translatable="false">
<item>WHEN_CHECKED_AUTO_SYNC</item>
<item>ALWAYS</item>
<item>NEVER</item>
</string-array>
<string-array name="font_entries">
<item>@string/font_size_default</item>
<item>@string/font_size_tiniest</item>
@ -666,26 +418,6 @@
<item>10</item>
</string-array>
<string-array name="settings_preview_lines_values" translatable="false">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
</string-array>
<string-array name="settings_preview_lines_entries">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
</string-array>
<string-array name="account_settings_quote_style_entries">
<item>@string/account_settings_quote_style_prefix</item>
<item>@string/account_settings_quote_style_header</item>
@ -728,55 +460,4 @@
<item>0</item>
</string-array>
<string-array name="global_settings_notification_hide_subject_entries">
<item name="1">@string/global_settings_notification_hide_subject_never</item>
<item name="2">@string/global_settings_notification_hide_subject_when_locked</item>
<item name="3">@string/global_settings_notification_hide_subject_always</item>
</string-array>
<string-array name="global_settings_notification_hide_subject_values" translatable="false">
<item name="1">NEVER</item>
<item name="2">WHEN_LOCKED</item>
<item name="3">ALWAYS</item>
</string-array>
<string-array name="global_settings_notification_quick_delete_entries">
<item name="1">@string/global_settings_notification_quick_delete_never</item>
<item name="2">@string/global_settings_notification_quick_delete_when_single_msg</item>
<item name="3">@string/global_settings_notification_quick_delete_always</item>
</string-array>
<string-array name="global_settings_notification_quick_delete_values" translatable="false">
<item name="1">NEVER</item>
<item name="2">FOR_SINGLE_MSG</item>
<item name="3">ALWAYS</item>
</string-array>
<string-array name="global_settings_lock_screen_notification_visibility_entries">
<item name="0">@string/global_settings_lock_screen_notification_visibility_nothing</item>
<item name="1">@string/global_settings_lock_screen_notification_visibility_app_name</item>
<item name="2">@string/global_settings_lock_screen_notification_visibility_message_count</item>
<item name="3">@string/global_settings_lock_screen_notification_visibility_senders</item>
<item name="4">@string/global_settings_lock_screen_notification_visibility_everything</item>
</string-array>
<string-array name="global_settings_lock_screen_notification_visibility_values" translatable="false">
<item name="0">NOTHING</item>
<item name="1">APP_NAME</item>
<item name="2">MESSAGE_COUNT</item>
<item name="3">SENDERS</item>
<item name="4">EVERYTHING</item>
</string-array>
<string-array name="global_settings_splitview_mode_entries">
<item>@string/global_settings_splitview_always</item>
<item>@string/global_settings_splitview_never</item>
<item>@string/global_settings_splitview_when_in_landscape</item>
</string-array>
<string-array name="global_settings_splitview_mode_values" translatable="false">
<item>ALWAYS</item>
<item>NEVER</item>
<item>WHEN_IN_LANDSCAPE</item>
</string-array>
</resources>

View file

@ -0,0 +1,368 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="supported_languages" translatable="false">
<item />
<item>in</item>
<item>br</item>
<item>ca</item>
<item>cs</item>
<item>cy</item>
<item>da</item>
<item>de</item>
<item>et</item>
<item>en</item>
<item>es</item>
<item>eo</item>
<item>eu</item>
<item>fr</item>
<item>gd</item>
<item>gl</item>
<item>hr</item>
<item>is</item>
<item>it</item>
<item>lv</item>
<item>lt</item>
<item>hu</item>
<item>nl</item>
<item>nb</item>
<item>pl</item>
<item>pt_PT</item>
<item>pt_BR</item>
<item>ru</item>
<item>ro</item>
<item>sq</item>
<item>sk</item>
<item>sl</item>
<item>fi</item>
<item>sv</item>
<item>tr</item>
<item>el</item>
<item>bg</item>
<item>sr</item>
<item>uk</item>
<item>iw</item>
<item>fa</item>
<item>ko</item>
<item>zh_CN</item>
<item>zh_TW</item>
<item>ja</item>
</string-array>
<string-array name="language_entries" translatable="false">
<item>@string/setting_language_system</item>
<item>Afrikaans</item>
<item>Azərbaycan</item>
<item>Bahasa indonesia</item>
<item>Bahasa melayu</item>
<item>Bamanankan</item>
<item>Brezhoneg</item>
<item>Català</item>
<item>Čeština</item>
<item>Cymraeg</item>
<item>Dansk</item>
<item>Deutsch</item>
<item>Eesti</item>
<item>English</item>
<item>Español</item>
<item>Esperanto</item>
<item>Euskera</item>
<item>Ɛʋɛ</item>
<item>Français</item>
<item>Français (Canada)</item>
<item>Fulfulde, Pulaar, Pular</item>
<item>Gaeilge</item>
<item>Gàidhlig</item>
<item>Galego</item>
<item>Hausa</item>
<item>Hrvatski</item>
<item>isiXhosa</item>
<item>isiZulu</item>
<item>Íslenska</item>
<item>Italiano</item>
<item>Kinyarwanda</item>
<item>Kirundi</item>
<item>Kiswahili</item>
<item>Latviešu</item>
<item>Lietuvių</item>
<item>Magyar</item>
<item>Malti</item>
<item>Nederlands</item>
<item>Norsk</item>
<item>Norsk Bokmål</item>
<item>O\'zbek</item>
<item>Polski</item>
<item>Português</item>
<item>Português (Brasil)</item>
<item>Pyccĸий</item>
<item>Română</item>
<item>Shqip</item>
<item>Slovenčina</item>
<item>Slovenščina</item>
<item>Somali</item>
<item>Suomi</item>
<item>Svenska</item>
<item>Tiếng Việt</item>
<item>Tϋrkçe</item>
<item>Wolof</item>
<item>Yorùbá</item>
<item>Ελληνικά</item>
<item>аҧсуа бызшәа</item>
<item>Беларуская</item>
<item>Български</item>
<item>Кыргыз</item>
<item>Қазақ</item>
<item>Македонски</item>
<item>Српски</item>
<item>Українська</item>
<item>Հայերեն</item>
<item>עברית</item>
<item>اردو</item>
<item>العربية</item>
<item>پښتو</item>
<item>فارسی</item>
<item>አማርኛ</item>
<item>हिंदी</item>
<item>తెలుగు</item>
<item>ಕನ್ನಡ</item>
<item>ภาษาไทย</item>
<item>한국어</item>
<item>中文(简体)</item>
<item>中文(繁體)</item>
<item>日本語</item>
</string-array>
<string-array name="language_values" translatable="false">
<item />
<item>af</item>
<item>az</item>
<item>in</item>
<item>ms</item>
<item>bm</item>
<item>br</item>
<item>ca</item>
<item>cs</item>
<item>cy</item>
<item>da</item>
<item>de</item>
<item>et</item>
<item>en</item>
<item>es</item>
<item>eo</item>
<item>eu</item>
<item>ee</item>
<item>fr</item>
<item>fr_CA</item>
<item>ff</item>
<item>ga</item>
<item>gd</item>
<item>gl</item>
<item>ha</item>
<item>hr</item>
<item>xs</item>
<item>zu</item>
<item>is</item>
<item>it</item>
<item>rw</item>
<item>rn</item>
<item>sw</item>
<item>lv</item>
<item>lt</item>
<item>hu</item>
<item>mt</item>
<item>nl</item>
<item>no</item>
<item>nb</item>
<item>uz</item>
<item>pl</item>
<item>pt_PT</item>
<item>pt_BR</item>
<item>ru</item>
<item>ro</item>
<item>sq</item>
<item>sk</item>
<item>sl</item>
<item>so</item>
<item>fi</item>
<item>sv</item>
<item>vi</item>
<item>tr</item>
<item>wo</item>
<item>yo</item>
<item>el</item>
<item>ab</item>
<item>be</item>
<item>bg</item>
<item>ky</item>
<item>kk</item>
<item>mk</item>
<item>sr</item>
<item>uk</item>
<item>hy</item>
<item>iw</item>
<item>ur</item>
<item>ar</item>
<item>ps</item>
<item>fa</item>
<item>am</item>
<item>hi</item>
<item>te</item>
<item>kn</item>
<item>th</item>
<item>ko</item>
<item>zh_CN</item>
<item>zh_TW</item>
<item>ja</item>
</string-array>
<string-array name="theme_entries">
<item>@string/setting_theme_light</item>
<item>@string/setting_theme_dark</item>
</string-array>
<string-array name="theme_values" translatable="false">
<item>light</item>
<item>dark</item>
</string-array>
<string-array name="message_theme_entries">
<item>@string/setting_theme_light</item>
<item>@string/setting_theme_dark</item>
<item>@string/setting_theme_global</item>
</string-array>
<string-array name="message_theme_values" translatable="false">
<item>light</item>
<item>dark</item>
<item>global</item>
</string-array>
<string-array name="background_ops_entries">
<item>@string/background_ops_auto_sync_only</item>
<item>@string/background_ops_always</item>
<item>@string/background_ops_never</item>
</string-array>
<string-array name="background_ops_values" translatable="false">
<item>WHEN_CHECKED_AUTO_SYNC</item>
<item>ALWAYS</item>
<item>NEVER</item>
</string-array>
<string-array name="preview_lines_entries">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
</string-array>
<string-array name="preview_lines_values" translatable="false">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
</string-array>
<string-array name="notification_hide_subject_entries">
<item name="1">@string/global_settings_notification_hide_subject_never</item>
<item name="2">@string/global_settings_notification_hide_subject_when_locked</item>
<item name="3">@string/global_settings_notification_hide_subject_always</item>
</string-array>
<string-array name="notification_hide_subject_values" translatable="false">
<item name="1">NEVER</item>
<item name="2">WHEN_LOCKED</item>
<item name="3">ALWAYS</item>
</string-array>
<string-array name="notification_quick_delete_entries">
<item name="1">@string/global_settings_notification_quick_delete_never</item>
<item name="2">@string/global_settings_notification_quick_delete_when_single_msg</item>
<item name="3">@string/global_settings_notification_quick_delete_always</item>
</string-array>
<string-array name="notification_quick_delete_values" translatable="false">
<item name="1">NEVER</item>
<item name="2">FOR_SINGLE_MSG</item>
<item name="3">ALWAYS</item>
</string-array>
<string-array name="lock_screen_notification_visibility_entries">
<item name="0">@string/global_settings_lock_screen_notification_visibility_nothing</item>
<item name="1">@string/global_settings_lock_screen_notification_visibility_app_name</item>
<item name="2">@string/global_settings_lock_screen_notification_visibility_message_count</item>
<item name="3">@string/global_settings_lock_screen_notification_visibility_senders</item>
<item name="4">@string/global_settings_lock_screen_notification_visibility_everything</item>
</string-array>
<string-array name="lock_screen_notification_visibility_values" translatable="false">
<item name="0">NOTHING</item>
<item name="1">APP_NAME</item>
<item name="2">MESSAGE_COUNT</item>
<item name="3">SENDERS</item>
<item name="4">EVERYTHING</item>
</string-array>
<string-array name="splitview_mode_entries">
<item>@string/global_settings_splitview_always</item>
<item>@string/global_settings_splitview_never</item>
<item>@string/global_settings_splitview_when_in_landscape</item>
</string-array>
<string-array name="splitview_mode_values" translatable="false">
<item>ALWAYS</item>
<item>NEVER</item>
<item>WHEN_IN_LANDSCAPE</item>
</string-array>
<string-array name="confirm_action_entries">
<item>@string/global_settings_confirm_action_delete</item>
<item>@string/global_settings_confirm_action_delete_starred</item>
<item>@string/global_settings_confirm_action_delete_notif</item>
<item>@string/global_settings_confirm_action_spam</item>
<item>@string/global_settings_confirm_menu_discard</item>
<item>@string/global_settings_confirm_menu_mark_all_read</item>
</string-array>
<string-array name="confirm_action_values" translatable="false">
<item>delete</item>
<item>delete_starred</item>
<item>delete_notif</item>
<item>spam</item>
<item>discard</item>
<item>mark_all_read</item>
</string-array>
<string-array name="messageview_visible_refile_actions_entries">
<item>@string/delete_action</item>
<item>@string/archive_action</item>
<item>@string/move_action</item>
<item>@string/copy_action</item>
<item>@string/spam_action</item>
</string-array>
<string-array name="messageview_visible_refile_actions_values" translatable="false">
<item>delete</item>
<item>archive</item>
<item>move</item>
<item>copy</item>
<item>spam</item>
</string-array>
<string-array name="volume_navigation_entries">
<item>@string/volume_navigation_message</item>
<item>@string/volume_navigation_list</item>
</string-array>
<string-array name="volume_navigation_values" translatable="false">
<item>message</item>
<item>list</item>
</string-array>
</resources>

View file

@ -10,6 +10,7 @@
<style name="Theme.K9.Dark.Base" parent="Theme.AppCompat" />
<style name="Theme.K9.Light.Common" parent="Theme.K9.Light.Base">
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
<item name="iconFolder">@drawable/ic_folder_light</item>
<item name="iconListItemMenu">@drawable/dropdown_ic_arrow_normal_holo_light</item>
<item name="iconMenuInfoDetails">@android:drawable/ic_menu_info_details</item>
@ -83,6 +84,7 @@
</style>
<style name="Theme.K9.Dark.Common" parent="Theme.K9.Dark.Base">
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
<item name="iconFolder">@drawable/ic_folder_dark</item>
<item name="iconListItemMenu">@drawable/dropdown_ic_arrow_normal_holo_dark</item>
<item name="iconMenuInfoDetails">@android:drawable/ic_menu_info_details</item>

View file

@ -1,116 +1,95 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2008 The Android Open Source Project
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.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!--
Make sure to add android:persistent="false" to all preferences to disable saving
the preference values to SharedPreferences. We use our own storage mechanism for
the preferences. See com.fsck.k9.preferences.Storage.
Also note that every sub-PreferenceScreen needs an "android:key" parameter so the correct screen
can be displayed after the device has been rotated.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<!--suppress AndroidElementNotAllowed -->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:title="@string/general_settings_title">
<PreferenceScreen
android:title="@string/display_preferences"
android:icon="?attr/iconPreferencesDisplay"
android:key="display_preferences">
android:key="display_preferences"
android:title="@string/display_preferences">
<PreferenceCategory
android:title="@string/global_preferences"
android:key="global_preferences">
android:key="global_preferences"
android:title="@string/global_preferences">
<ListPreference
android:persistent="false"
<com.fsck.k9.ui.settings.general.LanguagePreference
android:dialogTitle="@string/settings_language_label"
android:entries="@array/language_entries"
android:entryValues="@array/language_values"
android:key="language"
android:title="@string/settings_language_label"
android:entries="@array/settings_language_entries"
android:entryValues="@array/settings_language_values"
android:dialogTitle="@string/settings_language_label" />
android:summary="%s"
android:title="@string/settings_language_label" />
<ListPreference
android:persistent="false"
android:dialogTitle="@string/settings_theme_label"
android:entries="@array/theme_entries"
android:entryValues="@array/theme_values"
android:key="theme"
android:title="@string/settings_theme_label"
android:entries="@array/settings_theme_entries"
android:entryValues="@array/settings_theme_values"
android:dialogTitle="@string/settings_theme_label" />
android:summary="%s"
android:title="@string/settings_theme_label" />
<CheckBoxPreference
android:persistent="false"
android:key="fixed_message_view_theme"
android:title="@string/settings_message_theme_selection_label"
android:summaryOff="@string/settings_message_theme_selection_summary_off"
android:summaryOn="@string/settings_message_theme_selection_summary_on" />
android:summaryOn="@string/settings_message_theme_selection_summary_on"
android:title="@string/settings_message_theme_selection_label" />
<ListPreference
android:persistent="false"
android:dependency="fixed_message_view_theme"
android:dialogTitle="@string/settings_message_theme_label"
android:entries="@array/message_theme_entries"
android:entryValues="@array/message_theme_values"
android:key="messageViewTheme"
android:title="@string/settings_message_theme_label"
android:entries="@array/settings_message_theme_entries"
android:entryValues="@array/settings_message_theme_values"
android:dialogTitle="@string/settings_message_theme_label" />
android:summary="%s"
android:title="@string/settings_message_theme_label" />
<ListPreference
android:persistent="false"
android:dialogTitle="@string/settings_compose_theme_label"
android:entries="@array/message_theme_entries"
android:entryValues="@array/message_theme_values"
android:key="message_compose_theme"
android:title="@string/settings_compose_theme_label"
android:entries="@array/settings_message_theme_entries"
android:entryValues="@array/settings_message_theme_values"
android:dialogTitle="@string/settings_compose_theme_label" />
android:summary="%s"
android:title="@string/settings_compose_theme_label" />
<Preference
android:persistent="false"
android:key="font_size"
android:singleLine="true"
android:title="@string/font_size_settings_title"
android:summary="@string/font_size_settings_description" />
android:summary="@string/font_size_settings_description"
android:title="@string/font_size_settings_title">
<intent
android:targetClass="com.fsck.k9.activity.setup.FontSizeSettings"
android:targetPackage="@string/application_id" />
</Preference>
<CheckBoxPreference
android:persistent="false"
android:key="animations"
android:title="@string/animations_title"
android:summary="@string/animations_summary" />
android:summary="@string/animations_summary"
android:title="@string/animations_title" />
</PreferenceCategory>
<PreferenceCategory
android:title="@string/accountlist_preferences"
android:key="accountlist_preferences">
android:key="accountlist_preferences"
android:title="@string/accountlist_preferences">
<CheckBoxPreference
android:persistent="false"
android:key="measure_accounts"
android:title="@string/measure_accounts_title"
android:summary="@string/measure_accounts_summary" />
android:summary="@string/measure_accounts_summary"
android:title="@string/measure_accounts_title" />
<CheckBoxPreference
android:persistent="false"
android:key="count_search"
android:title="@string/count_search_title"
android:summary="@string/count_search_summary" />
android:summary="@string/count_search_summary"
android:title="@string/count_search_title" />
<CheckBoxPreference
android:persistent="false"
android:disableDependentsState="true"
android:key="hide_special_accounts"
android:title="@string/hide_special_accounts_title"
android:summary="@string/hide_special_accounts_summary"
android:disableDependentsState="true" />
android:title="@string/hide_special_accounts_title" />
</PreferenceCategory>
@ -119,308 +98,276 @@
android:title="@string/folderlist_preferences">
<CheckBoxPreference
android:persistent="false"
android:key="folderlist_wrap_folder_name"
android:title="@string/global_settings_folderlist_wrap_folder_names_label"
android:summary="@string/global_settings_folderlist_wrap_folder_names_summary" />
android:summary="@string/global_settings_folderlist_wrap_folder_names_summary"
android:title="@string/global_settings_folderlist_wrap_folder_names_label" />
</PreferenceCategory>
<PreferenceCategory
android:title="@string/messagelist_preferences"
android:key="messagelist_preferences">
android:key="messagelist_preferences"
android:title="@string/messagelist_preferences">
<ListPreference
android:persistent="false"
android:key="messagelist_preview_lines"
android:title="@string/global_settings_preview_lines_label"
android:entries="@array/settings_preview_lines_entries"
android:entryValues="@array/settings_preview_lines_values"
android:dialogTitle="@string/global_settings_preview_lines_label"
/>
android:entries="@array/preview_lines_entries"
android:entryValues="@array/preview_lines_values"
android:key="messagelist_preview_lines"
android:summary="%s"
android:title="@string/global_settings_preview_lines_label" />
<CheckBoxPreference
android:persistent="false"
android:key="messagelist_stars"
android:title="@string/global_settings_flag_label"
android:summary="@string/global_settings_flag_summary" />
android:summary="@string/global_settings_flag_summary"
android:title="@string/global_settings_flag_label" />
<CheckBoxPreference
android:persistent="false"
android:key="messagelist_checkboxes"
android:title="@string/global_settings_checkbox_label"
android:summary="@string/global_settings_checkbox_summary" />
android:summary="@string/global_settings_checkbox_summary"
android:title="@string/global_settings_checkbox_label" />
<CheckBoxPreference
android:persistent="false"
android:key="messagelist_show_correspondent_names"
android:title="@string/global_settings_show_correspondent_names_label"
android:summary="@string/global_settings_show_correspondent_names_summary"
android:title="@string/global_settings_show_correspondent_names_label" />
<CheckBoxPreference
android:key="messagelist_sender_above_subject"
android:summary="@string/global_settings_sender_above_subject_summary"
android:title="@string/global_settings_sender_above_subject_label" />
/>
<CheckBoxPreference
android:persistent="false"
android:key="messagelist_sender_above_subject"
android:title="@string/global_settings_sender_above_subject_label"
android:summary="@string/global_settings_sender_above_subject_summary" />
<CheckBoxPreference
android:persistent="false"
android:key="messagelist_show_contact_name"
android:title="@string/global_settings_show_contact_name_label"
android:summary="@string/global_settings_show_contact_name_summary"
android:dependency="messagelist_show_correspondent_names"
/>
android:key="messagelist_show_contact_name"
android:summary="@string/global_settings_show_contact_name_summary"
android:title="@string/global_settings_show_contact_name_label" />
<CheckBoxPreference
android:persistent="false"
android:key="messagelist_contact_name_color"
android:title="@string/global_settings_registered_name_color_label"
android:summary="@string/global_settings_registered_name_color_default"
android:dependency="messagelist_show_contact_name"
/>
android:key="messagelist_change_contact_name_color"
android:summary="@string/global_settings_registered_name_color_changed"
android:title="@string/global_settings_registered_name_color_label" />
<com.takisoft.fix.support.v7.preference.ColorPickerPreference
android:dependency="messagelist_change_contact_name_color"
android:key="messagelist_contact_name_color"
android:title="Contact name color" />
<CheckBoxPreference
android:persistent="false"
android:key="messagelist_show_contact_picture"
android:title="@string/global_settings_show_contact_picture_label"
android:summary="@string/global_settings_show_contact_picture_summary"
/>
android:title="@string/global_settings_show_contact_picture_label" />
<CheckBoxPreference
android:persistent="false"
android:key="messagelist_colorize_missing_contact_pictures"
android:title="@string/global_settings_colorize_missing_contact_pictures_label"
android:summary="@string/global_settings_colorize_missing_contact_pictures_summary"
android:dependency="messagelist_show_contact_picture"
/>
android:key="messagelist_colorize_missing_contact_pictures"
android:summary="@string/global_settings_colorize_missing_contact_pictures_summary"
android:title="@string/global_settings_colorize_missing_contact_pictures_label" />
<CheckBoxPreference
android:persistent="false"
android:key="messagelist_background_as_unread_indicator"
android:title="@string/global_settings_background_as_unread_indicator_label"
android:summary="@string/global_settings_background_as_unread_indicator_summary"
/>
android:title="@string/global_settings_background_as_unread_indicator_label" />
<CheckBoxPreference
android:persistent="false"
android:key="threaded_view"
android:title="@string/global_settings_threaded_view_label"
android:summary="@string/global_settings_threaded_view_summary" />
android:summary="@string/global_settings_threaded_view_summary"
android:title="@string/global_settings_threaded_view_label" />
<ListPreference
android:persistent="false"
android:dialogTitle="@string/global_settings_splitview_mode_label"
android:entries="@array/splitview_mode_entries"
android:entryValues="@array/splitview_mode_values"
android:key="splitview_mode"
android:title="@string/global_settings_splitview_mode_label"
android:entries="@array/global_settings_splitview_mode_entries"
android:entryValues="@array/global_settings_splitview_mode_values"
android:dialogTitle="@string/global_settings_splitview_mode_label" />
android:summary="%s"
android:title="@string/global_settings_splitview_mode_label" />
</PreferenceCategory>
<PreferenceCategory
android:title="@string/messageview_preferences"
android:key="messageview_preferences">
android:key="messageview_preferences"
android:title="@string/messageview_preferences">
<CheckBoxPreference
android:persistent="false"
android:key="messageview_fixedwidth_font"
android:title="@string/global_settings_messageview_fixedwidth_label"
android:summary="@string/global_settings_messageview_fixedwidth_summary" />
android:summary="@string/global_settings_messageview_fixedwidth_summary"
android:title="@string/global_settings_messageview_fixedwidth_label" />
<com.fsck.k9.preferences.CheckBoxListPreference
android:persistent="false"
android:key="messageview_visible_refile_actions"
android:title="@string/global_settings_messageview_visible_refile_actions_title"
android:summary="@string/global_settings_messageview_visible_refile_actions_summary"
<MultiSelectListPreference
android:dialogTitle="@string/global_settings_messageview_visible_refile_actions_title"
android:positiveButtonText="@android:string/ok"
android:negativeButtonText="@android:string/cancel" />
android:entries="@array/messageview_visible_refile_actions_entries"
android:entryValues="@array/messageview_visible_refile_actions_values"
android:key="messageview_visible_refile_actions"
android:summary="@string/global_settings_messageview_visible_refile_actions_summary"
android:title="@string/global_settings_messageview_visible_refile_actions_title" />
<CheckBoxPreference
android:persistent="false"
android:key="messageview_autofit_width"
android:title="@string/global_settings_messageview_autofit_width_label"
android:summary="@string/global_settings_messageview_autofit_width_summary"/>
android:summary="@string/global_settings_messageview_autofit_width_summary"
android:title="@string/global_settings_messageview_autofit_width_label" />
</PreferenceCategory>
</PreferenceScreen>
<PreferenceScreen
android:title="@string/interaction_preferences"
android:icon="?attr/iconPreferencesInteraction"
android:key="interaction_preferences">
android:key="interaction_preferences"
android:title="@string/interaction_preferences">
<CheckBoxPreference
android:persistent="false"
android:key="start_integrated_inbox"
android:title="@string/start_integrated_inbox_title"
android:dependency="hide_special_accounts" />
android:title="@string/start_integrated_inbox_title" />
<CheckBoxPreference
android:persistent="false"
android:key="gestures"
android:title="@string/gestures_title"
android:summary="@string/gestures_summary" />
android:summary="@string/gestures_summary"
android:title="@string/gestures_title" />
<com.fsck.k9.preferences.CheckBoxListPreference
android:persistent="false"
android:key="volume_navigation"
android:title="@string/volume_navigation_title"
<MultiSelectListPreference
android:dialogTitle="@string/volume_navigation_title"
android:positiveButtonText="@android:string/ok"
android:negativeButtonText="@android:string/cancel" />
android:entries="@array/volume_navigation_entries"
android:entryValues="@array/volume_navigation_values"
android:key="volume_navigation"
android:title="@string/volume_navigation_title" />
<CheckBoxPreference
android:persistent="false"
android:key="messageview_return_to_list"
android:title="@string/global_settings_messageview_return_to_list_label"
android:summary="@string/global_settings_messageview_return_to_list_summary" />
android:summary="@string/global_settings_messageview_return_to_list_summary"
android:title="@string/global_settings_messageview_return_to_list_label" />
<CheckBoxPreference
android:persistent="false"
android:key="messageview_show_next"
android:title="@string/global_settings_messageview_show_next_label"
android:summary="@string/global_settings_messageview_show_next_summary" />
android:summary="@string/global_settings_messageview_show_next_summary"
android:title="@string/global_settings_messageview_show_next_label" />
<com.fsck.k9.preferences.CheckBoxListPreference
android:persistent="false"
android:key="confirm_actions"
android:title="@string/global_settings_confirm_actions_title"
android:summary="@string/global_settings_confirm_actions_summary"
<MultiSelectListPreference
android:dialogTitle="@string/global_settings_confirm_actions_title"
android:positiveButtonText="@android:string/ok"
android:negativeButtonText="@android:string/cancel" />
android:entries="@array/confirm_action_entries"
android:entryValues="@array/confirm_action_values"
android:key="confirm_actions"
android:summary="@string/global_settings_confirm_actions_summary"
android:title="@string/global_settings_confirm_actions_title" />
</PreferenceScreen>
<PreferenceScreen
android:title="@string/notifications_title"
android:icon="?attr/iconPreferencesNotifications"
android:key="notification_preferences">
android:key="notification_preferences"
android:title="@string/notifications_title">
<CheckBoxPreference
android:key="quiet_time_enabled"
android:persistent="false"
android:title="@string/quiet_time"
android:summary="@string/quiet_time_description"
/>
android:title="@string/quiet_time" />
<CheckBoxPreference
android:dependency="quiet_time_enabled"
android:key="disable_notifications_during_quiet_time"
android:persistent="false"
android:dependency="quiet_time_enabled"
android:title="@string/quiet_time_notification"
android:summary="@string/quiet_time_notification_description"
/>
<com.fsck.k9.preferences.TimePickerPreference
android:title="@string/quiet_time_notification" />
<com.takisoft.fix.support.v7.preference.TimePickerPreference
android:dependency="quiet_time_enabled"
android:key="quiet_time_starts"
android:persistent="false"
android:dependency="quiet_time_enabled"
android:dialogTitle="@string/quiet_time_starts"
android:title="@string/quiet_time_starts"
/>
<com.fsck.k9.preferences.TimePickerPreference
android:key="quiet_time_ends"
app:pref_hourFormat="h24"
app:pref_summaryHasTime="%s" />
<com.takisoft.fix.support.v7.preference.TimePickerPreference
android:dependency="quiet_time_enabled"
android:persistent="false"
android:dialogTitle="@string/quiet_time_ends"
android:key="quiet_time_ends"
android:title="@string/quiet_time_ends"
/>
app:pref_hourFormat="h24"
app:pref_summaryHasTime="%s" />
<ListPreference
android:key="notification_quick_delete"
android:persistent="false"
android:title="@string/global_settings_notification_quick_delete_title"
android:entries="@array/global_settings_notification_quick_delete_entries"
android:entryValues="@array/global_settings_notification_quick_delete_values"
android:dialogTitle="@string/global_settings_notification_quick_delete_title"
android:summary="@string/global_settings_notification_quick_delete_description"
/>
android:entries="@array/notification_quick_delete_entries"
android:entryValues="@array/notification_quick_delete_values"
android:key="notification_quick_delete"
android:summary="%s"
android:title="@string/global_settings_notification_quick_delete_title" />
<ListPreference
android:dialogTitle="@string/global_settings_lock_screen_notification_visibility_title"
android:entries="@array/lock_screen_notification_visibility_entries"
android:entryValues="@array/lock_screen_notification_visibility_values"
android:key="lock_screen_notification_visibility"
android:persistent="false"
android:title="@string/global_settings_lock_screen_notification_visibility_title"
android:entries="@array/global_settings_lock_screen_notification_visibility_entries"
android:entryValues="@array/global_settings_lock_screen_notification_visibility_values"
android:dialogTitle="@string/global_settings_lock_screen_notification_visibility_title" />
android:summary="%s"
android:title="@string/global_settings_lock_screen_notification_visibility_title" />
</PreferenceScreen>
<PreferenceScreen
android:title="@string/network_preferences"
android:icon="?attr/iconPreferencesNetwork"
android:key="network_preferences">
android:key="network_preferences"
android:title="@string/network_preferences">
<ListPreference
android:persistent="false"
android:key="background_ops"
android:title="@string/background_ops_label"
android:dialogTitle="@string/background_ops_label"
android:entries="@array/background_ops_entries"
android:entryValues="@array/background_ops_values"
android:dialogTitle="@string/background_ops_label" />
android:key="background_ops"
android:summary="%s"
android:title="@string/background_ops_label" />
</PreferenceScreen>
<PreferenceScreen
android:title="@string/miscellaneous_preferences"
android:icon="?attr/iconPreferencesVarious"
android:key="misc_preferences">
android:key="misc_preferences"
android:title="@string/miscellaneous_preferences">
<Preference
android:persistent="false"
android:title="@string/settings_attachment_default_path"
android:key="attachment_default_path" />
android:key="attachment_default_path"
android:title="@string/settings_attachment_default_path" />
</PreferenceScreen>
<PreferenceScreen
android:title="@string/privacy_preferences"
android:icon="?attr/iconPreferencesPrivacy"
android:key="privacy_preferences">
android:key="privacy_preferences"
android:title="@string/privacy_preferences">
<ListPreference
android:persistent="false"
android:entries="@array/notification_hide_subject_entries"
android:entryValues="@array/notification_hide_subject_values"
android:key="notification_hide_subject"
android:entries="@array/global_settings_notification_hide_subject_entries"
android:entryValues="@array/global_settings_notification_hide_subject_values"
android:title="@string/global_settings_notification_hide_subject_title"/>
android:summary="%s"
android:title="@string/global_settings_notification_hide_subject_title" />
<CheckBoxPreference
android:persistent="false"
android:key="privacy_hide_useragent"
android:title="@string/global_settings_privacy_hide_useragent"
android:summary="@string/global_settings_privacy_hide_useragent_detail"/>
android:summary="@string/global_settings_privacy_hide_useragent_detail"
android:title="@string/global_settings_privacy_hide_useragent" />
<CheckBoxPreference
android:persistent="false"
android:key="privacy_hide_timezone"
android:title="@string/global_settings_privacy_hide_timezone"
android:summary="@string/global_settings_privacy_hide_timezone_detail"/>
android:summary="@string/global_settings_privacy_hide_timezone_detail"
android:title="@string/global_settings_privacy_hide_timezone" />
<CheckBoxPreference
android:persistent="false"
android:key="privacy_hide_hostname_when_connecting"
android:title="@string/global_settings_privacy_hide_hostname_when_connecting"
android:summary="@string/global_settings_privacy_hide_hostname_when_connecting_detail"/>
android:summary="@string/global_settings_privacy_hide_hostname_when_connecting_detail"
android:title="@string/global_settings_privacy_hide_hostname_when_connecting" />
</PreferenceScreen>
<PreferenceScreen
android:title="@string/debug_preferences"
android:icon="?attr/iconPreferencesDebug"
android:key="debug_preferences">
android:key="debug_preferences"
android:title="@string/debug_preferences">
<CheckBoxPreference
android:persistent="false"
android:key="debug_logging"
android:title="@string/debug_enable_debug_logging_title"
android:summary="@string/debug_enable_debug_logging_summary" />
android:summary="@string/debug_enable_debug_logging_summary"
android:title="@string/debug_enable_debug_logging_title" />
<CheckBoxPreference
android:persistent="false"
android:key="sensitive_logging"
android:title="@string/debug_enable_sensitive_logging_title"
android:summary="@string/debug_enable_sensitive_logging_summary" />
android:summary="@string/debug_enable_sensitive_logging_summary"
android:title="@string/debug_enable_sensitive_logging_title" />
</PreferenceScreen>