From 4dedf1b7958f2f739c1bca2fd0cae84947fa6dae Mon Sep 17 00:00:00 2001 From: cketti Date: Wed, 22 May 2019 00:32:37 +0200 Subject: [PATCH] Remove "messageViewShowNext" methods from 'K9' --- app/core/src/main/java/com/fsck/k9/K9.kt | 17 +++++------------ .../java/com/fsck/k9/activity/MessageList.java | 2 +- .../general/GeneralSettingsDataStore.kt | 4 ++-- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/app/core/src/main/java/com/fsck/k9/K9.kt b/app/core/src/main/java/com/fsck/k9/K9.kt index 41cdf6a8f..74504d3c6 100644 --- a/app/core/src/main/java/com/fsck/k9/K9.kt +++ b/app/core/src/main/java/com/fsck/k9/K9.kt @@ -232,7 +232,9 @@ object K9 : KoinComponent { @JvmStatic var isMessageViewReturnToList = false - private var messageViewShowNext = false + @JvmStatic + var isMessageViewShowNext = false + var isGesturesEnabled = true @JvmStatic @@ -328,15 +330,6 @@ object K9 : KoinComponent { updateLoggingStatus() } - @JvmStatic - fun messageViewShowNext(): Boolean { - return messageViewShowNext - } - - fun setMessageViewShowNext(messageViewShowNext: Boolean) { - K9.messageViewShowNext = messageViewShowNext - } - @JvmStatic fun measureAccounts(): Boolean { return measureAccounts @@ -525,7 +518,7 @@ object K9 : KoinComponent { contactNameColor = storage.getInt("registeredNameColor", -0xffff71) isUseMessageViewFixedWidthFont = storage.getBoolean("messageViewFixedWidthFont", false) isMessageViewReturnToList = storage.getBoolean("messageViewReturnToList", false) - messageViewShowNext = storage.getBoolean("messageViewShowNext", false) + isMessageViewShowNext = storage.getBoolean("messageViewShowNext", false) wrapFolderNames = storage.getBoolean("wrapFolderNames", false) hideUserAgent = storage.getBoolean("hideUserAgent", false) hideTimeZone = storage.getBoolean("hideTimeZone", false) @@ -645,7 +638,7 @@ object K9 : KoinComponent { editor.putInt("registeredNameColor", contactNameColor) editor.putBoolean("messageViewFixedWidthFont", isUseMessageViewFixedWidthFont) editor.putBoolean("messageViewReturnToList", isMessageViewReturnToList) - editor.putBoolean("messageViewShowNext", messageViewShowNext) + editor.putBoolean("messageViewShowNext", isMessageViewShowNext) editor.putBoolean("wrapFolderNames", wrapFolderNames) editor.putBoolean("hideUserAgent", hideUserAgent) editor.putBoolean("hideTimeZone", hideTimeZone) diff --git a/app/ui/src/main/java/com/fsck/k9/activity/MessageList.java b/app/ui/src/main/java/com/fsck/k9/activity/MessageList.java index 856a65c02..8ea721776 100644 --- a/app/ui/src/main/java/com/fsck/k9/activity/MessageList.java +++ b/app/ui/src/main/java/com/fsck/k9/activity/MessageList.java @@ -175,7 +175,7 @@ public class MessageList extends K9Activity implements MessageListFragmentListen private MenuItem menuButtonCheckMail; private View actionButtonIndeterminateProgress; - private int lastDirection = (K9.messageViewShowNext()) ? NEXT : PREVIOUS; + private int lastDirection = (K9.isMessageViewShowNext()) ? NEXT : PREVIOUS; /** * {@code true} if the message list should be displayed as flat list (i.e. no threading) diff --git a/app/ui/src/main/java/com/fsck/k9/ui/settings/general/GeneralSettingsDataStore.kt b/app/ui/src/main/java/com/fsck/k9/ui/settings/general/GeneralSettingsDataStore.kt index b09d8fc2a..490e5b842 100644 --- a/app/ui/src/main/java/com/fsck/k9/ui/settings/general/GeneralSettingsDataStore.kt +++ b/app/ui/src/main/java/com/fsck/k9/ui/settings/general/GeneralSettingsDataStore.kt @@ -38,7 +38,7 @@ class GeneralSettingsDataStore( "start_integrated_inbox" -> K9.isStartInUnifiedInbox "gestures" -> K9.isGesturesEnabled "messageview_return_to_list" -> K9.isMessageViewReturnToList - "messageview_show_next" -> K9.messageViewShowNext() + "messageview_show_next" -> K9.isMessageViewShowNext "quiet_time_enabled" -> K9.quietTimeEnabled "disable_notifications_during_quiet_time" -> !K9.isNotificationDuringQuietTimeEnabled "privacy_hide_useragent" -> K9.hideUserAgent() @@ -72,7 +72,7 @@ class GeneralSettingsDataStore( "start_integrated_inbox" -> K9.isStartInUnifiedInbox = value "gestures" -> K9.isGesturesEnabled = value "messageview_return_to_list" -> K9.isMessageViewReturnToList = value - "messageview_show_next" -> K9.setMessageViewShowNext(value) + "messageview_show_next" -> K9.isMessageViewShowNext = value "quiet_time_enabled" -> K9.quietTimeEnabled = value "disable_notifications_during_quiet_time" -> K9.isNotificationDuringQuietTimeEnabled = !value "privacy_hide_useragent" -> K9.setHideUserAgent(value)