From 13f2f7b581c2762a5aeb970d6a9da27922a0931c Mon Sep 17 00:00:00 2001 From: cketti Date: Wed, 22 May 2019 00:19:30 +0200 Subject: [PATCH] Remove "showCorrespondentNames" methods from 'K9' --- app/core/src/main/java/com/fsck/k9/K9.kt | 17 +++++------------ .../java/com/fsck/k9/helper/MessageHelper.java | 2 +- .../general/GeneralSettingsDataStore.kt | 4 ++-- .../com/fsck/k9/view/RecipientSelectView.java | 2 +- 4 files changed, 9 insertions(+), 16 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 f49f2cc7c..7a0819934 100644 --- a/app/core/src/main/java/com/fsck/k9/K9.kt +++ b/app/core/src/main/java/com/fsck/k9/K9.kt @@ -209,7 +209,9 @@ object K9 : KoinComponent { @JvmStatic var messageListPreviewLines = 2 - private var showCorrespondentNames = true + @JvmStatic + var isShowCorrespondentNames = true + private var messageListSenderAboveSubject = false private var showContactName = false private var changeContactNameColor = false @@ -316,11 +318,6 @@ object K9 : KoinComponent { updateLoggingStatus() } - @JvmStatic - fun showCorrespondentNames(): Boolean { - return showCorrespondentNames - } - @JvmStatic fun messageListSenderAboveSubject(): Boolean { return messageListSenderAboveSubject @@ -330,10 +327,6 @@ object K9 : KoinComponent { messageListSenderAboveSubject = sender } - fun setShowCorrespondentNames(showCorrespondentNames: Boolean) { - K9.showCorrespondentNames = showCorrespondentNames - } - @JvmStatic fun showContactName(): Boolean { return showContactName @@ -560,7 +553,7 @@ object K9 : KoinComponent { quietTimeStarts = storage.getString("quietTimeStarts", "21:00") quietTimeEnds = storage.getString("quietTimeEnds", "7:00") - showCorrespondentNames = storage.getBoolean("showCorrespondentNames", true) + isShowCorrespondentNames = storage.getBoolean("showCorrespondentNames", true) showContactName = storage.getBoolean("showContactName", false) showContactPicture = storage.getBoolean("showContactPicture", true) changeContactNameColor = storage.getBoolean("changeRegisteredNameColor", false) @@ -680,7 +673,7 @@ object K9 : KoinComponent { editor.putBoolean("messageListStars", isShowMessageListStars) editor.putInt("messageListPreviewLines", messageListPreviewLines) editor.putBoolean("messageListCheckboxes", isShowMessageListCheckboxes) - editor.putBoolean("showCorrespondentNames", showCorrespondentNames) + editor.putBoolean("showCorrespondentNames", isShowCorrespondentNames) editor.putBoolean("showContactName", showContactName) editor.putBoolean("showContactPicture", showContactPicture) editor.putBoolean("changeRegisteredNameColor", changeContactNameColor) diff --git a/app/core/src/main/java/com/fsck/k9/helper/MessageHelper.java b/app/core/src/main/java/com/fsck/k9/helper/MessageHelper.java index 47367863e..4be65208e 100644 --- a/app/core/src/main/java/com/fsck/k9/helper/MessageHelper.java +++ b/app/core/src/main/java/com/fsck/k9/helper/MessageHelper.java @@ -83,7 +83,7 @@ public class MessageHelper { */ public static CharSequence toFriendly(Address address, Contacts contacts) { return toFriendly(address,contacts, - K9.showCorrespondentNames(), + K9.isShowCorrespondentNames(), K9.changeContactNameColor(), K9.getContactNameColor()); } 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 5da6d63bd..8aaed3cb1 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 @@ -25,7 +25,7 @@ class GeneralSettingsDataStore( "folderlist_wrap_folder_name" -> K9.wrapFolderNames() "messagelist_stars" -> K9.isShowMessageListStars "messagelist_checkboxes" -> K9.isShowMessageListCheckboxes - "messagelist_show_correspondent_names" -> K9.showCorrespondentNames() + "messagelist_show_correspondent_names" -> K9.isShowCorrespondentNames "messagelist_sender_above_subject" -> K9.messageListSenderAboveSubject() "messagelist_show_contact_name" -> K9.showContactName() "messagelist_change_contact_name_color" -> K9.changeContactNameColor() @@ -59,7 +59,7 @@ class GeneralSettingsDataStore( "folderlist_wrap_folder_name" -> K9.setWrapFolderNames(value) "messagelist_stars" -> K9.isShowMessageListStars = value "messagelist_checkboxes" -> K9.isShowMessageListCheckboxes = value - "messagelist_show_correspondent_names" -> K9.setShowCorrespondentNames(value) + "messagelist_show_correspondent_names" -> K9.isShowCorrespondentNames = value "messagelist_sender_above_subject" -> K9.setMessageListSenderAboveSubject(value) "messagelist_show_contact_name" -> K9.setShowContactName(value) "messagelist_change_contact_name_color" -> K9.setChangeContactNameColor(value) diff --git a/app/ui/src/main/java/com/fsck/k9/view/RecipientSelectView.java b/app/ui/src/main/java/com/fsck/k9/view/RecipientSelectView.java index 605105b95..28c6f4765 100644 --- a/app/ui/src/main/java/com/fsck/k9/view/RecipientSelectView.java +++ b/app/ui/src/main/java/com/fsck/k9/view/RecipientSelectView.java @@ -631,7 +631,7 @@ public class RecipientSelectView extends TokenCompleteTextView implem } public String getDisplayNameOrAddress() { - final String displayName = K9.showCorrespondentNames() ? getDisplayName() : null; + final String displayName = K9.isShowCorrespondentNames() ? getDisplayName() : null; if (displayName != null) { return displayName;