Remove "showContactName" methods from 'K9'
This commit is contained in:
parent
596d5af260
commit
9db23ba7de
6 changed files with 11 additions and 18 deletions
|
@ -215,7 +215,9 @@ object K9 : KoinComponent {
|
|||
@JvmStatic
|
||||
var isMessageListSenderAboveSubject = false
|
||||
|
||||
private var showContactName = false
|
||||
@JvmStatic
|
||||
var isShowContactName = false
|
||||
|
||||
private var changeContactNameColor = false
|
||||
|
||||
@JvmStatic
|
||||
|
@ -320,15 +322,6 @@ object K9 : KoinComponent {
|
|||
updateLoggingStatus()
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun showContactName(): Boolean {
|
||||
return showContactName
|
||||
}
|
||||
|
||||
fun setShowContactName(showContactName: Boolean) {
|
||||
K9.showContactName = showContactName
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun changeContactNameColor(): Boolean {
|
||||
return changeContactNameColor
|
||||
|
@ -547,7 +540,7 @@ object K9 : KoinComponent {
|
|||
quietTimeEnds = storage.getString("quietTimeEnds", "7:00")
|
||||
|
||||
isShowCorrespondentNames = storage.getBoolean("showCorrespondentNames", true)
|
||||
showContactName = storage.getBoolean("showContactName", false)
|
||||
isShowContactName = storage.getBoolean("showContactName", false)
|
||||
showContactPicture = storage.getBoolean("showContactPicture", true)
|
||||
changeContactNameColor = storage.getBoolean("changeRegisteredNameColor", false)
|
||||
contactNameColor = storage.getInt("registeredNameColor", -0xffff71)
|
||||
|
@ -667,7 +660,7 @@ object K9 : KoinComponent {
|
|||
editor.putInt("messageListPreviewLines", messageListPreviewLines)
|
||||
editor.putBoolean("messageListCheckboxes", isShowMessageListCheckboxes)
|
||||
editor.putBoolean("showCorrespondentNames", isShowCorrespondentNames)
|
||||
editor.putBoolean("showContactName", showContactName)
|
||||
editor.putBoolean("showContactName", isShowContactName)
|
||||
editor.putBoolean("showContactPicture", showContactPicture)
|
||||
editor.putBoolean("changeRegisteredNameColor", changeContactNameColor)
|
||||
editor.putInt("registeredNameColor", contactNameColor)
|
||||
|
|
|
@ -47,7 +47,7 @@ public class MessageHelper {
|
|||
}
|
||||
|
||||
public CharSequence getDisplayName(Account account, Address[] fromAddrs, Address[] toAddrs) {
|
||||
final Contacts contactHelper = K9.showContactName() ? Contacts.getInstance(mContext) : null;
|
||||
final Contacts contactHelper = K9.isShowContactName() ? Contacts.getInstance(mContext) : null;
|
||||
|
||||
CharSequence displayName;
|
||||
if (fromAddrs.length > 0 && account.isAnIdentity(fromAddrs[0])) {
|
||||
|
|
|
@ -100,7 +100,7 @@ class NotificationContentCreator {
|
|||
|
||||
private String getMessageSender(Account account, Message message) {
|
||||
boolean isSelf = false;
|
||||
final Contacts contacts = K9.showContactName() ? Contacts.getInstance(context) : null;
|
||||
final Contacts contacts = K9.isShowContactName() ? Contacts.getInstance(context) : null;
|
||||
final Address[] fromAddresses = message.getFrom();
|
||||
|
||||
if (fromAddresses != null) {
|
||||
|
|
|
@ -27,7 +27,7 @@ class MessageInfoHolder {
|
|||
|
||||
public static MessageInfoHolder create(Context context, LocalMessage message,
|
||||
Account account) {
|
||||
Contacts contactHelper = K9.showContactName() ? Contacts.getInstance(context) : null;
|
||||
Contacts contactHelper = K9.isShowContactName() ? Contacts.getInstance(context) : null;
|
||||
|
||||
MessageInfoHolder target = new MessageInfoHolder();
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ class GeneralSettingsDataStore(
|
|||
"messagelist_checkboxes" -> K9.isShowMessageListCheckboxes
|
||||
"messagelist_show_correspondent_names" -> K9.isShowCorrespondentNames
|
||||
"messagelist_sender_above_subject" -> K9.isMessageListSenderAboveSubject
|
||||
"messagelist_show_contact_name" -> K9.showContactName()
|
||||
"messagelist_show_contact_name" -> K9.isShowContactName
|
||||
"messagelist_change_contact_name_color" -> K9.changeContactNameColor()
|
||||
"messagelist_show_contact_picture" -> K9.showContactPicture()
|
||||
"messagelist_colorize_missing_contact_pictures" -> K9.isColorizeMissingContactPictures
|
||||
|
@ -61,7 +61,7 @@ class GeneralSettingsDataStore(
|
|||
"messagelist_checkboxes" -> K9.isShowMessageListCheckboxes = value
|
||||
"messagelist_show_correspondent_names" -> K9.isShowCorrespondentNames = value
|
||||
"messagelist_sender_above_subject" -> K9.isMessageListSenderAboveSubject = value
|
||||
"messagelist_show_contact_name" -> K9.setShowContactName(value)
|
||||
"messagelist_show_contact_name" -> K9.isShowContactName = value
|
||||
"messagelist_change_contact_name_color" -> K9.setChangeContactNameColor(value)
|
||||
"messagelist_show_contact_picture" -> K9.setShowContactPicture(value)
|
||||
"messagelist_colorize_missing_contact_pictures" -> K9.isColorizeMissingContactPictures = value
|
||||
|
|
|
@ -269,7 +269,7 @@ public class MessageHeader extends LinearLayout implements OnClickListener, OnLo
|
|||
}
|
||||
|
||||
public void populate(final Message message, final Account account) {
|
||||
final Contacts contacts = K9.showContactName() ? mContacts : null;
|
||||
final Contacts contacts = K9.isShowContactName() ? mContacts : null;
|
||||
final CharSequence from = MessageHelper.toFriendly(message.getFrom(), contacts);
|
||||
final CharSequence to = MessageHelper.toFriendly(message.getRecipients(Message.RecipientType.TO), contacts);
|
||||
final CharSequence cc = MessageHelper.toFriendly(message.getRecipients(Message.RecipientType.CC), contacts);
|
||||
|
|
Loading…
Reference in a new issue