use of com.fsck.k9.K9.SplitViewMode in project k-9 by k9mail.
the class K9 method loadPrefs.
/**
* Load preferences into our statics.
*
* If you're adding a preference here, odds are you'll need to add it to
* {@link com.fsck.k9.preferences.GlobalSettings}, too.
*
* @param prefs Preferences to load
*/
public static void loadPrefs(Preferences prefs) {
Storage storage = prefs.getStorage();
setDebug(storage.getBoolean("enableDebugLogging", BuildConfig.DEVELOPER_MODE));
DEBUG_SENSITIVE = storage.getBoolean("enableSensitiveLogging", false);
mAnimations = storage.getBoolean("animations", true);
mGesturesEnabled = storage.getBoolean("gesturesEnabled", false);
mUseVolumeKeysForNavigation = storage.getBoolean("useVolumeKeysForNavigation", false);
mUseVolumeKeysForListNavigation = storage.getBoolean("useVolumeKeysForListNavigation", false);
mStartIntegratedInbox = storage.getBoolean("startIntegratedInbox", false);
mMeasureAccounts = storage.getBoolean("measureAccounts", true);
mCountSearchMessages = storage.getBoolean("countSearchMessages", true);
mHideSpecialAccounts = storage.getBoolean("hideSpecialAccounts", false);
mMessageListSenderAboveSubject = storage.getBoolean("messageListSenderAboveSubject", false);
mMessageListCheckboxes = storage.getBoolean("messageListCheckboxes", false);
mMessageListStars = storage.getBoolean("messageListStars", true);
mMessageListPreviewLines = storage.getInt("messageListPreviewLines", 2);
mAutofitWidth = storage.getBoolean("autofitWidth", true);
mQuietTimeEnabled = storage.getBoolean("quietTimeEnabled", false);
mNotificationDuringQuietTimeEnabled = storage.getBoolean("notificationDuringQuietTimeEnabled", true);
mQuietTimeStarts = storage.getString("quietTimeStarts", "21:00");
mQuietTimeEnds = storage.getString("quietTimeEnds", "7:00");
mShowCorrespondentNames = storage.getBoolean("showCorrespondentNames", true);
mShowContactName = storage.getBoolean("showContactName", false);
sShowContactPicture = storage.getBoolean("showContactPicture", true);
mChangeContactNameColor = storage.getBoolean("changeRegisteredNameColor", false);
mContactNameColor = storage.getInt("registeredNameColor", 0xff00008f);
mMessageViewFixedWidthFont = storage.getBoolean("messageViewFixedWidthFont", false);
mMessageViewReturnToList = storage.getBoolean("messageViewReturnToList", false);
mMessageViewShowNext = storage.getBoolean("messageViewShowNext", false);
mWrapFolderNames = storage.getBoolean("wrapFolderNames", false);
mHideUserAgent = storage.getBoolean("hideUserAgent", false);
mHideTimeZone = storage.getBoolean("hideTimeZone", false);
sOpenPgpProvider = storage.getString("openPgpProvider", NO_OPENPGP_PROVIDER);
sOpenPgpSupportSignOnly = storage.getBoolean("openPgpSupportSignOnly", false);
mConfirmDelete = storage.getBoolean("confirmDelete", false);
mConfirmDiscardMessage = storage.getBoolean("confirmDiscardMessage", true);
mConfirmDeleteStarred = storage.getBoolean("confirmDeleteStarred", false);
mConfirmSpam = storage.getBoolean("confirmSpam", false);
mConfirmDeleteFromNotification = storage.getBoolean("confirmDeleteFromNotification", true);
mConfirmMarkAllRead = storage.getBoolean("confirmMarkAllRead", true);
try {
String value = storage.getString("sortTypeEnum", Account.DEFAULT_SORT_TYPE.name());
mSortType = SortType.valueOf(value);
} catch (Exception e) {
mSortType = Account.DEFAULT_SORT_TYPE;
}
boolean sortAscending = storage.getBoolean("sortAscending", Account.DEFAULT_SORT_ASCENDING);
mSortAscending.put(mSortType, sortAscending);
String notificationHideSubject = storage.getString("notificationHideSubject", null);
if (notificationHideSubject == null) {
// If the "notificationHideSubject" setting couldn't be found, the app was probably
// updated. Look for the old "keyguardPrivacy" setting and map it to the new enum.
sNotificationHideSubject = (storage.getBoolean("keyguardPrivacy", false)) ? NotificationHideSubject.WHEN_LOCKED : NotificationHideSubject.NEVER;
} else {
sNotificationHideSubject = NotificationHideSubject.valueOf(notificationHideSubject);
}
String notificationQuickDelete = storage.getString("notificationQuickDelete", null);
if (notificationQuickDelete != null) {
sNotificationQuickDelete = NotificationQuickDelete.valueOf(notificationQuickDelete);
}
String lockScreenNotificationVisibility = storage.getString("lockScreenNotificationVisibility", null);
if (lockScreenNotificationVisibility != null) {
sLockScreenNotificationVisibility = LockScreenNotificationVisibility.valueOf(lockScreenNotificationVisibility);
}
String splitViewMode = storage.getString("splitViewMode", null);
if (splitViewMode != null) {
sSplitViewMode = SplitViewMode.valueOf(splitViewMode);
}
mAttachmentDefaultPath = storage.getString("attachmentdefaultpath", Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).toString());
sUseBackgroundAsUnreadIndicator = storage.getBoolean("useBackgroundAsUnreadIndicator", true);
sThreadedViewEnabled = storage.getBoolean("threadedView", true);
fontSizes.load(storage);
try {
setBackgroundOps(BACKGROUND_OPS.valueOf(storage.getString("backgroundOperations", BACKGROUND_OPS.WHEN_CHECKED_AUTO_SYNC.name())));
} catch (Exception e) {
setBackgroundOps(BACKGROUND_OPS.WHEN_CHECKED_AUTO_SYNC);
}
sColorizeMissingContactPictures = storage.getBoolean("colorizeMissingContactPictures", true);
sMessageViewArchiveActionVisible = storage.getBoolean("messageViewArchiveActionVisible", false);
sMessageViewDeleteActionVisible = storage.getBoolean("messageViewDeleteActionVisible", true);
sMessageViewMoveActionVisible = storage.getBoolean("messageViewMoveActionVisible", false);
sMessageViewCopyActionVisible = storage.getBoolean("messageViewCopyActionVisible", false);
sMessageViewSpamActionVisible = storage.getBoolean("messageViewSpamActionVisible", false);
sPgpInlineDialogCounter = storage.getInt("pgpInlineDialogCounter", 0);
sPgpSignOnlyDialogCounter = storage.getInt("pgpSignOnlyDialogCounter", 0);
int themeValue = storage.getInt("theme", Theme.LIGHT.ordinal());
// necessary.
if (themeValue == Theme.DARK.ordinal() || themeValue == android.R.style.Theme) {
K9.setK9Theme(Theme.DARK);
} else {
K9.setK9Theme(Theme.LIGHT);
}
themeValue = storage.getInt("messageViewTheme", Theme.USE_GLOBAL.ordinal());
K9.setK9MessageViewThemeSetting(Theme.values()[themeValue]);
themeValue = storage.getInt("messageComposeTheme", Theme.USE_GLOBAL.ordinal());
K9.setK9ComposerThemeSetting(Theme.values()[themeValue]);
K9.setUseFixedMessageViewTheme(storage.getBoolean("fixedMessageViewTheme", true));
}
use of com.fsck.k9.K9.SplitViewMode in project k-9 by k9mail.
the class MessageList method useSplitView.
private boolean useSplitView() {
SplitViewMode splitViewMode = K9.getSplitViewMode();
int orientation = getResources().getConfiguration().orientation;
return (splitViewMode == SplitViewMode.ALWAYS || (splitViewMode == SplitViewMode.WHEN_IN_LANDSCAPE && orientation == Configuration.ORIENTATION_LANDSCAPE));
}
Aggregations