From 94ddf85ce2b110c63a74909a6b3e252252f1a532 Mon Sep 17 00:00:00 2001 From: cketti Date: Thu, 15 Sep 2022 12:19:49 +0200 Subject: [PATCH 01/41] Remove code that we won't need in the future Co-authored-by: ByteHamster --- .../k9/ui/messageview/MessageTopView.java | 1 - .../java/com/fsck/k9/view/MessageHeader.java | 175 +----------------- .../com/fsck/k9/view/MessageHeaderTest.kt | 35 ---- 3 files changed, 2 insertions(+), 209 deletions(-) delete mode 100644 app/ui/legacy/src/test/java/com/fsck/k9/view/MessageHeaderTest.kt diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageTopView.java b/app/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageTopView.java index 0e5e910c32..69da139ded 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageTopView.java +++ b/app/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageTopView.java @@ -238,7 +238,6 @@ public class MessageTopView extends LinearLayout { public void setMessageCryptoPresenter(MessageCryptoPresenter messageCryptoPresenter) { this.messageCryptoPresenter = messageCryptoPresenter; - mHeaderContainer.setOnCryptoClickListener(messageCryptoPresenter); } public void enableDownloadButton() { diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java b/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java index 47c384edfa..b9f05006cb 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java +++ b/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java @@ -1,11 +1,7 @@ package com.fsck.k9.view; -import java.util.Arrays; - import android.content.Context; -import android.text.TextUtils; -import android.text.format.DateUtils; import android.util.AttributeSet; import android.view.View; import android.view.View.OnClickListener; @@ -21,20 +17,16 @@ import androidx.appcompat.widget.PopupMenu; import androidx.appcompat.widget.PopupMenu.OnMenuItemClickListener; import com.fsck.k9.Account; import com.fsck.k9.DI; -import com.fsck.k9.FontSizes; import com.fsck.k9.K9; import com.fsck.k9.activity.misc.ContactPicture; import com.fsck.k9.contacts.ContactPictureLoader; import com.fsck.k9.helper.ClipboardManager; -import com.fsck.k9.helper.Contacts; import com.fsck.k9.helper.MessageHelper; import com.fsck.k9.mail.Address; import com.fsck.k9.mail.Flag; import com.fsck.k9.mail.Message; import com.fsck.k9.ui.ContactBadge; import com.fsck.k9.ui.R; -import com.fsck.k9.ui.messageview.OnCryptoClickListener; -import timber.log.Timber; public class MessageHeader extends LinearLayout implements OnClickListener, OnLongClickListener { @@ -44,94 +36,34 @@ public class MessageHeader extends LinearLayout implements OnClickListener, OnLo private Context mContext; private TextView mFromView; - private TextView mSenderView; - private TextView mDateView; - private TextView mToView; - private TextView mToLabel; - private TextView mCcView; - private TextView mCcLabel; - private TextView mBccView; - private TextView mBccLabel; private TextView mSubjectView; private ImageView mCryptoStatusIcon; - - private View mChip; private CheckBox mFlagged; - private int defaultSubjectColor; - private View singleMessageOptionIcon; - private View mAnsweredIcon; - private View mForwardedIcon; - private Message mMessage; - private Account mAccount; - private FontSizes mFontSizes = K9.getFontSizes(); - private Contacts mContacts; + private ContactBadge mContactBadge; private MessageHelper mMessageHelper; private ContactPictureLoader mContactsPictureLoader; - private ContactBadge mContactBadge; - private OnCryptoClickListener onCryptoClickListener; private OnMenuItemClickListener onMenuItemClickListener; public MessageHeader(Context context, AttributeSet attrs) { super(context, attrs); mContext = context; - mContacts = Contacts.getInstance(mContext); } @Override protected void onFinishInflate() { super.onFinishInflate(); - mAnsweredIcon = findViewById(R.id.answered); - mForwardedIcon = findViewById(R.id.forwarded); mFromView = findViewById(R.id.from); - mSenderView = findViewById(R.id.sender); - mToView = findViewById(R.id.to); - mToLabel = findViewById(R.id.to_label); - mCcView = findViewById(R.id.cc); - mCcLabel = findViewById(R.id.cc_label); - mBccView = findViewById(R.id.bcc); - mBccLabel = findViewById(R.id.bcc_label); - mContactBadge = findViewById(R.id.contact_badge); - - singleMessageOptionIcon = findViewById(R.id.icon_single_message_options); - mSubjectView = findViewById(R.id.subject); - mChip = findViewById(R.id.chip); - mDateView = findViewById(R.id.date); mFlagged = findViewById(R.id.flagged); - - defaultSubjectColor = mSubjectView.getCurrentTextColor(); - mFontSizes.setViewTextSize(mSubjectView, mFontSizes.getMessageViewSubject()); - mFontSizes.setViewTextSize(mDateView, mFontSizes.getMessageViewDate()); - - mFontSizes.setViewTextSize(mFromView, mFontSizes.getMessageViewSender()); - mFontSizes.setViewTextSize(mToView, mFontSizes.getMessageViewTo()); - mFontSizes.setViewTextSize(mToLabel, mFontSizes.getMessageViewTo()); - mFontSizes.setViewTextSize(mCcView, mFontSizes.getMessageViewCC()); - mFontSizes.setViewTextSize(mCcLabel, mFontSizes.getMessageViewCC()); - mFontSizes.setViewTextSize(mBccView, mFontSizes.getMessageViewBCC()); - mFontSizes.setViewTextSize(mBccLabel, mFontSizes.getMessageViewBCC()); - - singleMessageOptionIcon.setOnClickListener(this); + mCryptoStatusIcon = findViewById(R.id.crypto_status_icon); mSubjectView.setOnClickListener(this); - mFromView.setOnClickListener(this); - mToView.setOnClickListener(this); - mCcView.setOnClickListener(this); - mBccView.setOnClickListener(this); - mSubjectView.setOnLongClickListener(this); - mFromView.setOnLongClickListener(this); - mToView.setOnLongClickListener(this); - mCcView.setOnLongClickListener(this); - mBccView.setOnLongClickListener(this); - - mCryptoStatusIcon = findViewById(R.id.crypto_status_icon); - mCryptoStatusIcon.setOnClickListener(this); mMessageHelper = MessageHelper.getInstance(mContext); } @@ -141,12 +73,6 @@ public class MessageHeader extends LinearLayout implements OnClickListener, OnLo int id = view.getId(); if (id == R.id.subject) { toggleSubjectViewMaxLines(); - } else if (id == R.id.from) { - onAddSenderToContacts(); - } else if (id == R.id.to || id == R.id.cc || id == R.id.bcc) { - expand((TextView)view, ((TextView)view).getEllipsize() != null); - } else if (id == R.id.crypto_status_icon) { - onCryptoClickListener.onCryptoClick(); } else if (id == R.id.icon_single_message_options) { PopupMenu popupMenu = new PopupMenu(getContext(), view); popupMenu.setOnMenuItemClickListener(onMenuItemClickListener); @@ -161,12 +87,6 @@ public class MessageHeader extends LinearLayout implements OnClickListener, OnLo if (id == R.id.subject) { onAddSubjectToClipboard(mSubjectView.getText().toString()); - } else if (id == R.id.from) { - onAddAddressesToClipboard(mMessage.getFrom()); - } else if (id == R.id.to) { - onAddRecipientsToClipboard(Message.RecipientType.TO); - } else if (id == R.id.cc) { - onAddRecipientsToClipboard(Message.RecipientType.CC); } return true; @@ -186,36 +106,10 @@ public class MessageHeader extends LinearLayout implements OnClickListener, OnLo Toast.makeText(mContext, createMessageForSubject(), Toast.LENGTH_LONG).show(); } - private void onAddSenderToContacts() { - if (mMessage != null) { - try { - final Address senderEmail = mMessage.getFrom()[0]; - mContacts.createContact(senderEmail); - } catch (Exception e) { - Timber.e(e, "Couldn't create contact"); - } - } - } - public String createMessageForSubject() { return mContext.getResources().getString(R.string.copy_subject_to_clipboard); } - public String createMessage(int addressesCount) { - return mContext.getResources().getQuantityString(R.plurals.copy_address_to_clipboard, addressesCount); - } - - private void onAddAddressesToClipboard(Address[] addresses) { - String addressList = Address.toString(addresses); - clipboardManager.setText("addresses", addressList); - - Toast.makeText(mContext, createMessage(addresses.length), Toast.LENGTH_LONG).show(); - } - - private void onAddRecipientsToClipboard(Message.RecipientType recipientType) { - onAddAddressesToClipboard(mMessage.getRecipients(recipientType)); - } - public void setOnFlagListener(OnClickListener listener) { mFlagged.setOnClickListener(listener); } @@ -227,14 +121,7 @@ public class MessageHeader extends LinearLayout implements OnClickListener, OnLo fromAddress = fromAddresses[0]; } - final Contacts contacts = K9.isShowContactName() ? mContacts : null; final CharSequence from = mMessageHelper.getSenderDisplayName(fromAddress); - final CharSequence to = MessageHelper.toFriendly(message.getRecipients(Message.RecipientType.TO), contacts); - final CharSequence cc = MessageHelper.toFriendly(message.getRecipients(Message.RecipientType.CC), contacts); - final CharSequence bcc = MessageHelper.toFriendly(message.getRecipients(Message.RecipientType.BCC), contacts); - - mMessage = message; - mAccount = account; if (K9.isShowContactPicture()) { mContactBadge.setVisibility(View.VISIBLE); @@ -243,23 +130,6 @@ public class MessageHeader extends LinearLayout implements OnClickListener, OnLo mContactBadge.setVisibility(View.GONE); } - if (shouldShowSender(message)) { - mSenderView.setVisibility(VISIBLE); - String sender = getResources().getString(R.string.message_view_sender_label, - MessageHelper.toFriendly(message.getSender(), contacts)); - mSenderView.setText(sender); - } else { - mSenderView.setVisibility(View.GONE); - } - - String dateTime = DateUtils.formatDateTime(mContext, - message.getSentDate().getTime(), - DateUtils.FORMAT_SHOW_DATE - | DateUtils.FORMAT_ABBREV_ALL - | DateUtils.FORMAT_SHOW_TIME - | DateUtils.FORMAT_SHOW_YEAR); - mDateView.setText(dateTime); - if (K9.isShowContactPicture()) { if (fromAddress != null) { mContactBadge.setContact(fromAddress); @@ -271,12 +141,6 @@ public class MessageHeader extends LinearLayout implements OnClickListener, OnLo mFromView.setText(from); - updateAddressField(mToView, to, mToLabel); - updateAddressField(mCcView, cc, mCcLabel); - updateAddressField(mBccView, bcc, mBccLabel); - mAnsweredIcon.setVisibility(message.isSet(Flag.ANSWERED) ? View.VISIBLE : View.GONE); - mForwardedIcon.setVisibility(message.isSet(Flag.FORWARDED) ? View.VISIBLE : View.GONE); - if (showStar) { mFlagged.setVisibility(View.VISIBLE); mFlagged.setChecked(message.isSet(Flag.FLAGGED)); @@ -284,21 +148,11 @@ public class MessageHeader extends LinearLayout implements OnClickListener, OnLo mFlagged.setVisibility(View.GONE); } - mChip.setBackgroundColor(mAccount.getChipColor()); - setVisibility(View.VISIBLE); } public void setSubject(@NonNull String subject) { mSubjectView.setText(subject); - mSubjectView.setTextColor(0xff000000 | defaultSubjectColor); - } - - public static boolean shouldShowSender(Message message) { - Address[] from = message.getFrom(); - Address[] sender = message.getSender(); - - return sender != null && sender.length != 0 && !Arrays.equals(from, sender); } public void hideCryptoStatus() { @@ -325,31 +179,6 @@ public class MessageHeader extends LinearLayout implements OnClickListener, OnLo mCryptoStatusIcon.setColorFilter(color); } - private void updateAddressField(TextView v, CharSequence text, View label) { - boolean hasText = !TextUtils.isEmpty(text); - - v.setText(text); - v.setVisibility(hasText ? View.VISIBLE : View.GONE); - label.setVisibility(hasText ? View.VISIBLE : View.GONE); - } - - /** - * Expand or collapse a TextView by removing or adding the 2 lines limitation - */ - private void expand(TextView v, boolean expand) { - if (expand) { - v.setMaxLines(Integer.MAX_VALUE); - v.setEllipsize(null); - } else { - v.setMaxLines(2); - v.setEllipsize(android.text.TextUtils.TruncateAt.END); - } - } - - public void setOnCryptoClickListener(OnCryptoClickListener onCryptoClickListener) { - this.onCryptoClickListener = onCryptoClickListener; - } - public void setOnMenuItemClickListener(OnMenuItemClickListener onMenuItemClickListener) { this.onMenuItemClickListener = onMenuItemClickListener; } diff --git a/app/ui/legacy/src/test/java/com/fsck/k9/view/MessageHeaderTest.kt b/app/ui/legacy/src/test/java/com/fsck/k9/view/MessageHeaderTest.kt deleted file mode 100644 index 0802c749e9..0000000000 --- a/app/ui/legacy/src/test/java/com/fsck/k9/view/MessageHeaderTest.kt +++ /dev/null @@ -1,35 +0,0 @@ -package com.fsck.k9.view - -import com.fsck.k9.RobolectricTest -import com.fsck.k9.mail.Address -import com.fsck.k9.mail.internet.MimeMessage -import com.google.common.truth.Truth.assertThat -import org.junit.Test - -class MessageHeaderTest : RobolectricTest() { - - @Test - fun shouldShowSender_withSender_shouldReturnTrue() { - val message = createMessage("from@example1.com", "sender@example2.com") - - val showSender = MessageHeader.shouldShowSender(message) - - assertThat(showSender).isTrue() - } - - @Test - fun shouldShowSender_withoutSender_shouldReturnFalse() { - val message = createMessage("from@example1.com") - - val showSender = MessageHeader.shouldShowSender(message) - - assertThat(showSender).isFalse() - } - - private fun createMessage(from: String, sender: String? = null) = MimeMessage().apply { - setFrom(from.toAddress()) - setSender(sender?.toAddress()) - } - - private fun String.toAddress() = Address.parse(this)[0] -} -- GitLab From d585e2b5485abfa1d6aac8f1aaf0bc7534fff335 Mon Sep 17 00:00:00 2001 From: cketti Date: Thu, 15 Sep 2022 12:29:11 +0200 Subject: [PATCH 02/41] Clean up code a bit --- .../java/com/fsck/k9/view/MessageHeader.java | 88 +++++++++---------- 1 file changed, 41 insertions(+), 47 deletions(-) diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java b/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java index b9f05006cb..07d5a81821 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java +++ b/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java @@ -32,40 +32,35 @@ import com.fsck.k9.ui.R; public class MessageHeader extends LinearLayout implements OnClickListener, OnLongClickListener { private static final int DEFAULT_SUBJECT_LINES = 3; - private final ClipboardManager clipboardManager = DI.get(ClipboardManager.class); + private TextView subjectView; + private CheckBox starView; + private ContactBadge contactBadge; + private TextView fromView; + private ImageView cryptoStatusIcon; - private Context mContext; - private TextView mFromView; - private TextView mSubjectView; - private ImageView mCryptoStatusIcon; - private CheckBox mFlagged; - private ContactBadge mContactBadge; - - private MessageHelper mMessageHelper; - private ContactPictureLoader mContactsPictureLoader; + private MessageHelper messageHelper; private OnMenuItemClickListener onMenuItemClickListener; public MessageHeader(Context context, AttributeSet attrs) { super(context, attrs); - mContext = context; } @Override protected void onFinishInflate() { super.onFinishInflate(); - mFromView = findViewById(R.id.from); - mContactBadge = findViewById(R.id.contact_badge); - mSubjectView = findViewById(R.id.subject); - mFlagged = findViewById(R.id.flagged); - mCryptoStatusIcon = findViewById(R.id.crypto_status_icon); + subjectView = findViewById(R.id.subject); + starView = findViewById(R.id.flagged); + contactBadge = findViewById(R.id.contact_badge); + fromView = findViewById(R.id.from); + cryptoStatusIcon = findViewById(R.id.crypto_status_icon); - mSubjectView.setOnClickListener(this); - mSubjectView.setOnLongClickListener(this); + subjectView.setOnClickListener(this); + subjectView.setOnLongClickListener(this); - mMessageHelper = MessageHelper.getInstance(mContext); + messageHelper = MessageHelper.getInstance(getContext()); } @Override @@ -86,32 +81,33 @@ public class MessageHeader extends LinearLayout implements OnClickListener, OnLo int id = view.getId(); if (id == R.id.subject) { - onAddSubjectToClipboard(mSubjectView.getText().toString()); + onAddSubjectToClipboard(subjectView.getText().toString()); } return true; } private void toggleSubjectViewMaxLines() { - if (mSubjectView.getMaxLines() == DEFAULT_SUBJECT_LINES) { - mSubjectView.setMaxLines(Integer.MAX_VALUE); + if (subjectView.getMaxLines() == DEFAULT_SUBJECT_LINES) { + subjectView.setMaxLines(Integer.MAX_VALUE); } else { - mSubjectView.setMaxLines(DEFAULT_SUBJECT_LINES); + subjectView.setMaxLines(DEFAULT_SUBJECT_LINES); } } private void onAddSubjectToClipboard(String subject) { + ClipboardManager clipboardManager = DI.get(ClipboardManager.class); clipboardManager.setText("subject", subject); - Toast.makeText(mContext, createMessageForSubject(), Toast.LENGTH_LONG).show(); + Toast.makeText(getContext(), createMessageForSubject(), Toast.LENGTH_LONG).show(); } public String createMessageForSubject() { - return mContext.getResources().getString(R.string.copy_subject_to_clipboard); + return getResources().getString(R.string.copy_subject_to_clipboard); } public void setOnFlagListener(OnClickListener listener) { - mFlagged.setOnClickListener(listener); + starView.setOnClickListener(listener); } public void populate(final Message message, final Account account, boolean showStar) { @@ -121,42 +117,40 @@ public class MessageHeader extends LinearLayout implements OnClickListener, OnLo fromAddress = fromAddresses[0]; } - final CharSequence from = mMessageHelper.getSenderDisplayName(fromAddress); - if (K9.isShowContactPicture()) { - mContactBadge.setVisibility(View.VISIBLE); - mContactsPictureLoader = ContactPicture.getContactPictureLoader(); - } else { - mContactBadge.setVisibility(View.GONE); - } + contactBadge.setVisibility(View.VISIBLE); - if (K9.isShowContactPicture()) { if (fromAddress != null) { - mContactBadge.setContact(fromAddress); - mContactsPictureLoader.setContactPicture(mContactBadge, fromAddress); + contactBadge.setContact(fromAddress); + + ContactPictureLoader contactsPictureLoader = ContactPicture.getContactPictureLoader(); + contactsPictureLoader.setContactPicture(contactBadge, fromAddress); } else { - mContactBadge.setImageResource(R.drawable.ic_contact_picture); + contactBadge.setImageResource(R.drawable.ic_contact_picture); } + } else { + contactBadge.setVisibility(View.GONE); } - mFromView.setText(from); + CharSequence from = messageHelper.getSenderDisplayName(fromAddress); + fromView.setText(from); if (showStar) { - mFlagged.setVisibility(View.VISIBLE); - mFlagged.setChecked(message.isSet(Flag.FLAGGED)); + starView.setVisibility(View.VISIBLE); + starView.setChecked(message.isSet(Flag.FLAGGED)); } else { - mFlagged.setVisibility(View.GONE); + starView.setVisibility(View.GONE); } setVisibility(View.VISIBLE); } public void setSubject(@NonNull String subject) { - mSubjectView.setText(subject); + subjectView.setText(subject); } public void hideCryptoStatus() { - mCryptoStatusIcon.setVisibility(View.GONE); + cryptoStatusIcon.setVisibility(View.GONE); } public void setCryptoStatusLoading() { @@ -173,10 +167,10 @@ public class MessageHeader extends LinearLayout implements OnClickListener, OnLo private void setCryptoDisplayStatus(MessageCryptoDisplayStatus displayStatus) { int color = ThemeUtils.getStyledColor(getContext(), displayStatus.getColorAttr()); - mCryptoStatusIcon.setEnabled(displayStatus.isEnabled()); - mCryptoStatusIcon.setVisibility(View.VISIBLE); - mCryptoStatusIcon.setImageResource(displayStatus.getStatusIconRes()); - mCryptoStatusIcon.setColorFilter(color); + cryptoStatusIcon.setEnabled(displayStatus.isEnabled()); + cryptoStatusIcon.setVisibility(View.VISIBLE); + cryptoStatusIcon.setImageResource(displayStatus.getStatusIconRes()); + cryptoStatusIcon.setColorFilter(color); } public void setOnMenuItemClickListener(OnMenuItemClickListener onMenuItemClickListener) { -- GitLab From a31db513b92cddb2e76ea1ecf3c284ceae87c704 Mon Sep 17 00:00:00 2001 From: cketti Date: Thu, 15 Sep 2022 12:30:33 +0200 Subject: [PATCH 03/41] For now always show contact picture in message view --- .../java/com/fsck/k9/view/MessageHeader.java | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java b/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java index 07d5a81821..6b25c20ea1 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java +++ b/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java @@ -17,7 +17,6 @@ import androidx.appcompat.widget.PopupMenu; import androidx.appcompat.widget.PopupMenu.OnMenuItemClickListener; import com.fsck.k9.Account; import com.fsck.k9.DI; -import com.fsck.k9.K9; import com.fsck.k9.activity.misc.ContactPicture; import com.fsck.k9.contacts.ContactPictureLoader; import com.fsck.k9.helper.ClipboardManager; @@ -117,19 +116,13 @@ public class MessageHeader extends LinearLayout implements OnClickListener, OnLo fromAddress = fromAddresses[0]; } - if (K9.isShowContactPicture()) { - contactBadge.setVisibility(View.VISIBLE); + if (fromAddress != null) { + contactBadge.setContact(fromAddress); - if (fromAddress != null) { - contactBadge.setContact(fromAddress); - - ContactPictureLoader contactsPictureLoader = ContactPicture.getContactPictureLoader(); - contactsPictureLoader.setContactPicture(contactBadge, fromAddress); - } else { - contactBadge.setImageResource(R.drawable.ic_contact_picture); - } - } else { - contactBadge.setVisibility(View.GONE); + ContactPictureLoader contactsPictureLoader = ContactPicture.getContactPictureLoader(); + contactsPictureLoader.setContactPicture(contactBadge, fromAddress); + } else { + contactBadge.setImageResource(R.drawable.ic_contact_picture); } CharSequence from = messageHelper.getSenderDisplayName(fromAddress); -- GitLab From 7aa0c77b4a7f495aa7a28251cfe5a19502a37c5e Mon Sep 17 00:00:00 2001 From: cketti Date: Thu, 15 Sep 2022 13:25:34 +0200 Subject: [PATCH 04/41] Change message view header layout Co-authored-by: ByteHamster --- .../k9/ui/helper/BottomBaselineTextView.kt | 21 + .../java/com/fsck/k9/view/MessageHeader.java | 44 +- .../src/main/res/drawable/btn_select_star.xml | 5 + .../src/main/res/drawable/dots_vertical.xml | 10 + .../main/res/layout/message_view_header.xml | 460 +++++++----------- 5 files changed, 244 insertions(+), 296 deletions(-) create mode 100644 app/ui/legacy/src/main/java/com/fsck/k9/ui/helper/BottomBaselineTextView.kt create mode 100644 app/ui/legacy/src/main/res/drawable/btn_select_star.xml create mode 100644 app/ui/legacy/src/main/res/drawable/dots_vertical.xml diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/ui/helper/BottomBaselineTextView.kt b/app/ui/legacy/src/main/java/com/fsck/k9/ui/helper/BottomBaselineTextView.kt new file mode 100644 index 0000000000..8769cb805a --- /dev/null +++ b/app/ui/legacy/src/main/java/com/fsck/k9/ui/helper/BottomBaselineTextView.kt @@ -0,0 +1,21 @@ +package com.fsck.k9.ui.helper + +import android.content.Context +import android.util.AttributeSet +import androidx.appcompat.widget.AppCompatTextView + +/** + * Return the baseline of the last line of text, instead of TextView's default of the first line. + */ +// Source: https://stackoverflow.com/a/62419876 +class BottomBaselineTextView @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null +) : AppCompatTextView(context, attrs) { + + override fun getBaseline(): Int { + val layout = layout ?: return super.getBaseline() + val baselineOffset = super.getBaseline() - layout.getLineBaseline(0) + return baselineOffset + layout.getLineBaseline(layout.lineCount - 1) + } +} diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java b/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java index 6b25c20ea1..a7312d1ced 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java +++ b/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java @@ -2,11 +2,11 @@ package com.fsck.k9.view; import android.content.Context; +import android.content.res.ColorStateList; import android.util.AttributeSet; import android.view.View; import android.view.View.OnClickListener; import android.view.View.OnLongClickListener; -import android.widget.CheckBox; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; @@ -24,16 +24,18 @@ import com.fsck.k9.helper.MessageHelper; import com.fsck.k9.mail.Address; import com.fsck.k9.mail.Flag; import com.fsck.k9.mail.Message; -import com.fsck.k9.ui.ContactBadge; import com.fsck.k9.ui.R; +import com.google.android.material.chip.Chip; +import com.google.android.material.snackbar.Snackbar; public class MessageHeader extends LinearLayout implements OnClickListener, OnLongClickListener { private static final int DEFAULT_SUBJECT_LINES = 3; + private Chip accountChip; private TextView subjectView; - private CheckBox starView; - private ContactBadge contactBadge; + private ImageView starView; + private ImageView contactPictureView; private TextView fromView; private ImageView cryptoStatusIcon; @@ -44,22 +46,35 @@ public class MessageHeader extends LinearLayout implements OnClickListener, OnLo public MessageHeader(Context context, AttributeSet attrs) { super(context, attrs); + + if (!isInEditMode()) { + messageHelper = MessageHelper.getInstance(getContext()); + } } @Override protected void onFinishInflate() { super.onFinishInflate(); + accountChip = findViewById(R.id.chip); subjectView = findViewById(R.id.subject); starView = findViewById(R.id.flagged); - contactBadge = findViewById(R.id.contact_badge); + contactPictureView = findViewById(R.id.contact_picture); fromView = findViewById(R.id.from); cryptoStatusIcon = findViewById(R.id.crypto_status_icon); subjectView.setOnClickListener(this); subjectView.setOnLongClickListener(this); - messageHelper = MessageHelper.getInstance(getContext()); + View menuPrimaryActionView = findViewById(R.id.menu_primary_action); + menuPrimaryActionView.setOnClickListener(this); + menuPrimaryActionView.setOnLongClickListener(this); + + View menuOverflowView = findViewById(R.id.menu_overflow); + menuOverflowView.setOnClickListener(this); + menuOverflowView.setOnLongClickListener(this); + + findViewById(R.id.participants_container).setOnClickListener(this); } @Override @@ -67,11 +82,15 @@ public class MessageHeader extends LinearLayout implements OnClickListener, OnLo int id = view.getId(); if (id == R.id.subject) { toggleSubjectViewMaxLines(); - } else if (id == R.id.icon_single_message_options) { + } else if (id == R.id.menu_primary_action) { + Snackbar.make(getRootView(), "TODO: Perform primary action", Snackbar.LENGTH_LONG).show(); + } else if (id == R.id.menu_overflow) { PopupMenu popupMenu = new PopupMenu(getContext(), view); popupMenu.setOnMenuItemClickListener(onMenuItemClickListener); popupMenu.inflate(R.menu.single_message_options); popupMenu.show(); + } else if (id == R.id.participants_container) { + Snackbar.make(getRootView(), "TODO: Display details popup", Snackbar.LENGTH_LONG).show(); } } @@ -110,6 +129,9 @@ public class MessageHeader extends LinearLayout implements OnClickListener, OnLo } public void populate(final Message message, final Account account, boolean showStar) { + accountChip.setText(account.getDisplayName()); + accountChip.setChipBackgroundColor(ColorStateList.valueOf(account.getChipColor())); + Address fromAddress = null; Address[] fromAddresses = message.getFrom(); if (fromAddresses.length > 0) { @@ -117,12 +139,10 @@ public class MessageHeader extends LinearLayout implements OnClickListener, OnLo } if (fromAddress != null) { - contactBadge.setContact(fromAddress); - ContactPictureLoader contactsPictureLoader = ContactPicture.getContactPictureLoader(); - contactsPictureLoader.setContactPicture(contactBadge, fromAddress); + contactsPictureLoader.setContactPicture(contactPictureView, fromAddress); } else { - contactBadge.setImageResource(R.drawable.ic_contact_picture); + contactPictureView.setImageResource(R.drawable.ic_contact_picture); } CharSequence from = messageHelper.getSenderDisplayName(fromAddress); @@ -130,7 +150,7 @@ public class MessageHeader extends LinearLayout implements OnClickListener, OnLo if (showStar) { starView.setVisibility(View.VISIBLE); - starView.setChecked(message.isSet(Flag.FLAGGED)); + starView.setSelected(message.isSet(Flag.FLAGGED)); } else { starView.setVisibility(View.GONE); } diff --git a/app/ui/legacy/src/main/res/drawable/btn_select_star.xml b/app/ui/legacy/src/main/res/drawable/btn_select_star.xml new file mode 100644 index 0000000000..dbab9d79d2 --- /dev/null +++ b/app/ui/legacy/src/main/res/drawable/btn_select_star.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/app/ui/legacy/src/main/res/drawable/dots_vertical.xml b/app/ui/legacy/src/main/res/drawable/dots_vertical.xml new file mode 100644 index 0000000000..14ff51ef8b --- /dev/null +++ b/app/ui/legacy/src/main/res/drawable/dots_vertical.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/ui/legacy/src/main/res/layout/message_view_header.xml b/app/ui/legacy/src/main/res/layout/message_view_header.xml index 38a67868a4..a3133f78e8 100644 --- a/app/ui/legacy/src/main/res/layout/message_view_header.xml +++ b/app/ui/legacy/src/main/res/layout/message_view_header.xml @@ -1,297 +1,189 @@ - + android:layout_height="wrap_content" + android:orientation="vertical"> - + android:layout_height="wrap_content"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + android:layout_height="wrap_content" + android:background="?attr/colorPrimary" + android:clickable="true" + android:focusable="true" + android:foreground="?attr/selectableItemBackground" + android:gravity="center_vertical" + android:orientation="horizontal"> + + + + + + + + + + + + + + + + + + -- GitLab From c3c6c25d883d06f2dc0eb376fd2e8cad0992b1c6 Mon Sep 17 00:00:00 2001 From: cketti Date: Thu, 15 Sep 2022 22:19:20 +0200 Subject: [PATCH 05/41] Fix layout when account chip is hidden --- .../src/main/res/layout/message_view_header.xml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/ui/legacy/src/main/res/layout/message_view_header.xml b/app/ui/legacy/src/main/res/layout/message_view_header.xml index a3133f78e8..efc1f24c02 100644 --- a/app/ui/legacy/src/main/res/layout/message_view_header.xml +++ b/app/ui/legacy/src/main/res/layout/message_view_header.xml @@ -11,6 +11,12 @@ android:layout_width="match_parent" android:layout_height="wrap_content"> + + + + Date: Tue, 20 Sep 2022 11:24:22 +0200 Subject: [PATCH 06/41] Only show account chip in message view when showing it in the message list --- .../java/com/fsck/k9/activity/MessageList.kt | 5 ++++- .../fsck/k9/fragment/MessageListFragment.kt | 5 ++++- .../k9/ui/messageview/MessageTopView.java | 8 +++++++- .../MessageViewContainerFragment.kt | 20 ++++++++++++++----- .../k9/ui/messageview/MessageViewFragment.kt | 12 +++++++++-- .../java/com/fsck/k9/view/MessageHeader.java | 11 +++++++--- 6 files changed, 48 insertions(+), 13 deletions(-) diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt b/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt index 6425672393..9278e375d0 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt @@ -139,6 +139,9 @@ open class MessageList : private var viewSwitcher: ViewSwitcher? = null private lateinit var recentChangesSnackbar: Snackbar + private val isShowAccountChip: Boolean + get() = messageListFragment?.isShowAccountChip ?: true + public override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -1018,7 +1021,7 @@ open class MessageList : if (draftsFolderId != null && folderId == draftsFolderId) { MessageActions.actionEditDraft(this, messageReference) } else { - val fragment = MessageViewContainerFragment.newInstance(messageReference) + val fragment = MessageViewContainerFragment.newInstance(messageReference, isShowAccountChip) supportFragmentManager.commitNow { replace(R.id.message_view_container, fragment, FRAGMENT_TAG_MESSAGE_VIEW_CONTAINER) } diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.kt b/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.kt index 061bd58d9b..224e4f7191 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.kt @@ -143,6 +143,9 @@ class MessageListFragment : invalidateMenu() } + val isShowAccountChip: Boolean + get() = !isSingleAccountMode + override fun onAttach(context: Context) { super.onAttach(context) @@ -475,7 +478,7 @@ class MessageListFragment : showContactPicture = K9.isShowContactPicture, showingThreadedList = showingThreadedList, backGroundAsReadIndicator = K9.isUseBackgroundAsUnreadIndicator, - showAccountChip = !isSingleAccountMode + showAccountChip = isShowAccountChip ) private fun getFolderInfoHolder(folderId: Long, account: Account): FolderInfoHolder { diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageTopView.java b/app/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageTopView.java index 69da139ded..da82cc2dcf 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageTopView.java +++ b/app/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageTopView.java @@ -55,6 +55,8 @@ public class MessageTopView extends LinearLayout { private boolean isShowingProgress; private boolean showPicturesButtonClicked; + private boolean showAccountChip; + private MessageCryptoPresenter messageCryptoPresenter; @@ -84,6 +86,10 @@ public class MessageTopView extends LinearLayout { hideHeaderView(); } + public void setShowAccountChip(boolean showAccountChip) { + this.showAccountChip = showAccountChip; + } + private void setShowPicturesButtonListener() { showPicturesButton.setOnClickListener(new OnClickListener() { @Override @@ -208,7 +214,7 @@ public class MessageTopView extends LinearLayout { } public void setHeaders(Message message, Account account, boolean showStar) { - mHeaderContainer.populate(message, account, showStar); + mHeaderContainer.populate(message, account, showStar, showAccountChip); mHeaderContainer.setVisibility(View.VISIBLE); } diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageViewContainerFragment.kt b/app/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageViewContainerFragment.kt index 4501c25075..31b66f40cf 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageViewContainerFragment.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageViewContainerFragment.kt @@ -29,6 +29,8 @@ class MessageViewContainerFragment : Fragment() { setMenuVisibility(value) } + private var showAccountChip: Boolean = true + lateinit var messageReference: MessageReference private set @@ -72,7 +74,9 @@ class MessageViewContainerFragment : Fragment() { lastDirection = savedInstanceState.getSerializable(STATE_LAST_DIRECTION) as Direction? } - adapter = MessageViewContainerAdapter(this) + showAccountChip = arguments?.getBoolean(ARG_SHOW_ACCOUNT_CHIP) ?: showAccountChip + + adapter = MessageViewContainerAdapter(this, showAccountChip) } override fun onAttach(context: Context) { @@ -234,7 +238,11 @@ class MessageViewContainerFragment : Fragment() { findMessageViewFragment().onPendingIntentResult(requestCode, resultCode, data) } - private class MessageViewContainerAdapter(fragment: Fragment) : FragmentStateAdapter(fragment) { + private class MessageViewContainerAdapter( + fragment: Fragment, + private val showAccountChip: Boolean + ) : FragmentStateAdapter(fragment) { + var messageList: List = emptyList() set(value) { val diffResult = DiffUtil.calculateDiff( @@ -262,7 +270,7 @@ class MessageViewContainerFragment : Fragment() { check(position in messageList.indices) val messageReference = messageList[position].messageReference - return MessageViewFragment.newInstance(messageReference) + return MessageViewFragment.newInstance(messageReference, showAccountChip) } fun getMessageReference(position: Int): MessageReference { @@ -305,13 +313,15 @@ class MessageViewContainerFragment : Fragment() { companion object { private const val ARG_REFERENCE = "reference" + private const val ARG_SHOW_ACCOUNT_CHIP = "showAccountChip" private const val STATE_MESSAGE_REFERENCE = "messageReference" private const val STATE_LAST_DIRECTION = "lastDirection" - fun newInstance(reference: MessageReference): MessageViewContainerFragment { + fun newInstance(reference: MessageReference, showAccountChip: Boolean): MessageViewContainerFragment { return MessageViewContainerFragment().withArguments( - ARG_REFERENCE to reference.toIdentityString() + ARG_REFERENCE to reference.toIdentityString(), + ARG_SHOW_ACCOUNT_CHIP to showAccountChip ) } } diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageViewFragment.kt b/app/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageViewFragment.kt index a7de139a0c..bd47f3c309 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageViewFragment.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageViewFragment.kt @@ -86,6 +86,7 @@ class MessageViewFragment : private lateinit var account: Account lateinit var messageReference: MessageReference + private var showAccountChip: Boolean = true private var currentAttachmentViewInfo: AttachmentViewInfo? = null private var isDeleteMenuItemDisabled: Boolean = false @@ -109,6 +110,9 @@ class MessageViewFragment : messageReference = MessageReference.parse(arguments?.getString(ARG_REFERENCE)) ?: error("Invalid argument '$ARG_REFERENCE'") + showAccountChip = arguments?.getBoolean(ARG_SHOW_ACCOUNT_CHIP) + ?: error("Missing argument: '$ARG_SHOW_ACCOUNT_CHIP'") + if (savedInstanceState != null) { wasMessageMarkedAsOpened = savedInstanceState.getBoolean(STATE_WAS_MESSAGE_MARKED_AS_OPENED) } @@ -136,6 +140,8 @@ class MessageViewFragment : } private fun initializeMessageTopView(messageTopView: MessageTopView) { + messageTopView.setShowAccountChip(showAccountChip) + messageTopView.setAttachmentCallback(this) messageTopView.setMessageCryptoPresenter(messageCryptoPresenter) @@ -940,6 +946,7 @@ class MessageViewFragment : const val PROGRESS_THRESHOLD_MILLIS = 500 * 1000 private const val ARG_REFERENCE = "reference" + private const val ARG_SHOW_ACCOUNT_CHIP = "showAccountChip" private const val STATE_WAS_MESSAGE_MARKED_AS_OPENED = "wasMessageMarkedAsOpened" @@ -947,9 +954,10 @@ class MessageViewFragment : private const val ACTIVITY_CHOOSE_FOLDER_COPY = 2 private const val REQUEST_CODE_CREATE_DOCUMENT = 3 - fun newInstance(reference: MessageReference): MessageViewFragment { + fun newInstance(reference: MessageReference, showAccountChip: Boolean): MessageViewFragment { return MessageViewFragment().withArguments( - ARG_REFERENCE to reference.toIdentityString() + ARG_REFERENCE to reference.toIdentityString(), + ARG_SHOW_ACCOUNT_CHIP to showAccountChip ) } } diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java b/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java index a7312d1ced..5294dc0b34 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java +++ b/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java @@ -128,9 +128,14 @@ public class MessageHeader extends LinearLayout implements OnClickListener, OnLo starView.setOnClickListener(listener); } - public void populate(final Message message, final Account account, boolean showStar) { - accountChip.setText(account.getDisplayName()); - accountChip.setChipBackgroundColor(ColorStateList.valueOf(account.getChipColor())); + public void populate(final Message message, final Account account, boolean showStar, boolean showAccountChip) { + if (showAccountChip) { + accountChip.setVisibility(View.VISIBLE); + accountChip.setText(account.getDisplayName()); + accountChip.setChipBackgroundColor(ColorStateList.valueOf(account.getChipColor())); + } else { + accountChip.setVisibility(View.GONE); + } Address fromAddress = null; Address[] fromAddresses = message.getFrom(); -- GitLab From 20f7e3eafece753cc81f77a2c9174c4b66797ae5 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sat, 29 Oct 2022 19:57:08 +0200 Subject: [PATCH 07/41] Display date on new MessageView --- .../main/java/com/fsck/k9/view/MessageHeader.java | 12 ++++++++++++ .../src/main/res/layout/message_view_header.xml | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java b/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java index 5294dc0b34..70eb698dae 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java +++ b/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java @@ -16,6 +16,7 @@ import androidx.annotation.NonNull; import androidx.appcompat.widget.PopupMenu; import androidx.appcompat.widget.PopupMenu.OnMenuItemClickListener; import com.fsck.k9.Account; +import com.fsck.k9.Clock; import com.fsck.k9.DI; import com.fsck.k9.activity.misc.ContactPicture; import com.fsck.k9.contacts.ContactPictureLoader; @@ -25,6 +26,7 @@ import com.fsck.k9.mail.Address; import com.fsck.k9.mail.Flag; import com.fsck.k9.mail.Message; import com.fsck.k9.ui.R; +import com.fsck.k9.ui.helper.RelativeDateTimeFormatter; import com.google.android.material.chip.Chip; import com.google.android.material.snackbar.Snackbar; @@ -38,8 +40,10 @@ public class MessageHeader extends LinearLayout implements OnClickListener, OnLo private ImageView contactPictureView; private TextView fromView; private ImageView cryptoStatusIcon; + private TextView dateView; private MessageHelper messageHelper; + private final RelativeDateTimeFormatter relativeDateTimeFormatter; private OnMenuItemClickListener onMenuItemClickListener; @@ -50,6 +54,7 @@ public class MessageHeader extends LinearLayout implements OnClickListener, OnLo if (!isInEditMode()) { messageHelper = MessageHelper.getInstance(getContext()); } + relativeDateTimeFormatter = new RelativeDateTimeFormatter(getContext(), DI.get(Clock.class)); } @Override @@ -62,6 +67,7 @@ public class MessageHeader extends LinearLayout implements OnClickListener, OnLo contactPictureView = findViewById(R.id.contact_picture); fromView = findViewById(R.id.from); cryptoStatusIcon = findViewById(R.id.crypto_status_icon); + dateView = findViewById(R.id.date); subjectView.setOnClickListener(this); subjectView.setOnLongClickListener(this); @@ -160,6 +166,12 @@ public class MessageHeader extends LinearLayout implements OnClickListener, OnLo starView.setVisibility(View.GONE); } + if (message.getSentDate() != null) { + dateView.setText(relativeDateTimeFormatter.formatDate(message.getSentDate().getTime())); + } else { + dateView.setText(""); + } + setVisibility(View.VISIBLE); } diff --git a/app/ui/legacy/src/main/res/layout/message_view_header.xml b/app/ui/legacy/src/main/res/layout/message_view_header.xml index efc1f24c02..52b7fe92b9 100644 --- a/app/ui/legacy/src/main/res/layout/message_view_header.xml +++ b/app/ui/legacy/src/main/res/layout/message_view_header.xml @@ -120,12 +120,12 @@ android:layout_marginEnd="16dp" android:ellipsize="none" android:singleLine="true" - android:text="Sep 19" android:textAppearance="@style/TextAppearance.MaterialComponents.Caption" android:textColor="?android:attr/textColorSecondary" app:layout_constraintBaseline_toBaselineOf="@+id/from" app:layout_constraintEnd_toStartOf="@+id/menu_primary_action" - app:layout_constraintStart_toEndOf="@id/from" /> + app:layout_constraintStart_toEndOf="@id/from" + tools:text="Sep 19" /> Date: Sun, 30 Oct 2022 02:20:35 +0200 Subject: [PATCH 08/41] Use Koin to retrieve `RelativeDateTimeFormatter` --- app/ui/legacy/src/main/java/com/fsck/k9/view/KoinModule.kt | 4 +++- .../legacy/src/main/java/com/fsck/k9/view/MessageHeader.java | 5 ++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/view/KoinModule.kt b/app/ui/legacy/src/main/java/com/fsck/k9/view/KoinModule.kt index 076cf0c583..d86dd2b718 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/view/KoinModule.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/view/KoinModule.kt @@ -1,7 +1,9 @@ package com.fsck.k9.view +import com.fsck.k9.ui.helper.RelativeDateTimeFormatter import org.koin.dsl.module val viewModule = module { - single { WebViewConfigProvider(get()) } + single { WebViewConfigProvider(themeManager = get()) } + factory { RelativeDateTimeFormatter(context = get(), clock = get()) } } diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java b/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java index 70eb698dae..343e172141 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java +++ b/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java @@ -16,7 +16,6 @@ import androidx.annotation.NonNull; import androidx.appcompat.widget.PopupMenu; import androidx.appcompat.widget.PopupMenu.OnMenuItemClickListener; import com.fsck.k9.Account; -import com.fsck.k9.Clock; import com.fsck.k9.DI; import com.fsck.k9.activity.misc.ContactPicture; import com.fsck.k9.contacts.ContactPictureLoader; @@ -43,7 +42,7 @@ public class MessageHeader extends LinearLayout implements OnClickListener, OnLo private TextView dateView; private MessageHelper messageHelper; - private final RelativeDateTimeFormatter relativeDateTimeFormatter; + private RelativeDateTimeFormatter relativeDateTimeFormatter; private OnMenuItemClickListener onMenuItemClickListener; @@ -53,8 +52,8 @@ public class MessageHeader extends LinearLayout implements OnClickListener, OnLo if (!isInEditMode()) { messageHelper = MessageHelper.getInstance(getContext()); + relativeDateTimeFormatter = DI.get(RelativeDateTimeFormatter.class); } - relativeDateTimeFormatter = new RelativeDateTimeFormatter(getContext(), DI.get(Clock.class)); } @Override -- GitLab From b5b691e6117f92796c1277d1a02ad9066a35498d Mon Sep 17 00:00:00 2001 From: cketti Date: Mon, 31 Oct 2022 13:25:32 +0100 Subject: [PATCH 09/41] Respect setting to hide contact picture --- .../main/java/com/fsck/k9/view/MessageHeader.java | 14 ++++++++++---- .../src/main/res/layout/message_view_header.xml | 6 +++++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java b/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java index 343e172141..238ba03327 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java +++ b/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java @@ -17,6 +17,7 @@ import androidx.appcompat.widget.PopupMenu; import androidx.appcompat.widget.PopupMenu.OnMenuItemClickListener; import com.fsck.k9.Account; import com.fsck.k9.DI; +import com.fsck.k9.K9; import com.fsck.k9.activity.misc.ContactPicture; import com.fsck.k9.contacts.ContactPictureLoader; import com.fsck.k9.helper.ClipboardManager; @@ -148,11 +149,16 @@ public class MessageHeader extends LinearLayout implements OnClickListener, OnLo fromAddress = fromAddresses[0]; } - if (fromAddress != null) { - ContactPictureLoader contactsPictureLoader = ContactPicture.getContactPictureLoader(); - contactsPictureLoader.setContactPicture(contactPictureView, fromAddress); + if (K9.isShowContactPicture()) { + contactPictureView.setVisibility(View.VISIBLE); + if (fromAddress != null) { + ContactPictureLoader contactsPictureLoader = ContactPicture.getContactPictureLoader(); + contactsPictureLoader.setContactPicture(contactPictureView, fromAddress); + } else { + contactPictureView.setImageResource(R.drawable.ic_contact_picture); + } } else { - contactPictureView.setImageResource(R.drawable.ic_contact_picture); + contactPictureView.setVisibility(View.GONE); } CharSequence from = messageHelper.getSenderDisplayName(fromAddress); diff --git a/app/ui/legacy/src/main/res/layout/message_view_header.xml b/app/ui/legacy/src/main/res/layout/message_view_header.xml index 52b7fe92b9..f70740b097 100644 --- a/app/ui/legacy/src/main/res/layout/message_view_header.xml +++ b/app/ui/legacy/src/main/res/layout/message_view_header.xml @@ -99,6 +99,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="16dp" + android:layout_marginTop="16dp" android:layout_marginEnd="8dp" android:ellipsize="end" android:gravity="center_vertical" @@ -110,7 +111,7 @@ app:layout_constraintHorizontal_bias="0.0" app:layout_constraintHorizontal_chainStyle="packed" app:layout_constraintStart_toEndOf="@id/contact_picture" - app:layout_constraintTop_toTopOf="@+id/contact_picture" + app:layout_constraintTop_toTopOf="parent" tools:text="Sender name" /> Date: Mon, 14 Nov 2022 17:54:20 +0100 Subject: [PATCH 10/41] Respect font size settings in message view - Remove now unnecessary settings. - Rearrange items in the settings screen to match the display order in the message view screen. - Change setting name from "To" to "Recipients". --- .../src/main/java/com/fsck/k9/FontSizes.java | 57 +++---------------- .../k9/activity/MessageListActivityConfig.kt | 10 +--- .../general/GeneralSettingsDataStore.kt | 10 +--- .../java/com/fsck/k9/view/MessageHeader.java | 13 +++++ .../legacy/src/main/res/values-ar/strings.xml | 3 - .../legacy/src/main/res/values-be/strings.xml | 4 -- .../legacy/src/main/res/values-bg/strings.xml | 4 -- .../legacy/src/main/res/values-br/strings.xml | 4 -- .../legacy/src/main/res/values-ca/strings.xml | 4 -- .../legacy/src/main/res/values-cs/strings.xml | 4 -- .../legacy/src/main/res/values-cy/strings.xml | 4 -- .../legacy/src/main/res/values-da/strings.xml | 4 -- .../legacy/src/main/res/values-de/strings.xml | 4 -- .../legacy/src/main/res/values-el/strings.xml | 4 -- .../legacy/src/main/res/values-eo/strings.xml | 4 -- .../legacy/src/main/res/values-es/strings.xml | 4 -- .../legacy/src/main/res/values-et/strings.xml | 4 -- .../legacy/src/main/res/values-eu/strings.xml | 4 -- .../legacy/src/main/res/values-fa/strings.xml | 4 -- .../legacy/src/main/res/values-fi/strings.xml | 4 -- .../legacy/src/main/res/values-fr/strings.xml | 4 -- .../legacy/src/main/res/values-fy/strings.xml | 4 -- .../legacy/src/main/res/values-gd/strings.xml | 4 -- .../src/main/res/values-gl-rES/strings.xml | 4 -- .../legacy/src/main/res/values-gl/strings.xml | 4 -- .../legacy/src/main/res/values-hr/strings.xml | 4 -- .../legacy/src/main/res/values-hu/strings.xml | 4 -- .../legacy/src/main/res/values-in/strings.xml | 4 -- .../legacy/src/main/res/values-is/strings.xml | 4 -- .../legacy/src/main/res/values-it/strings.xml | 4 -- .../legacy/src/main/res/values-iw/strings.xml | 4 -- .../legacy/src/main/res/values-ja/strings.xml | 4 -- .../legacy/src/main/res/values-ko/strings.xml | 4 -- .../legacy/src/main/res/values-lt/strings.xml | 4 -- .../legacy/src/main/res/values-lv/strings.xml | 4 -- .../legacy/src/main/res/values-ml/strings.xml | 4 -- .../legacy/src/main/res/values-nb/strings.xml | 4 -- .../legacy/src/main/res/values-nl/strings.xml | 4 -- .../legacy/src/main/res/values-pl/strings.xml | 4 -- .../src/main/res/values-pt-rBR/strings.xml | 4 -- .../src/main/res/values-pt-rPT/strings.xml | 4 -- .../legacy/src/main/res/values-ro/strings.xml | 4 -- .../legacy/src/main/res/values-ru/strings.xml | 4 -- .../legacy/src/main/res/values-sk/strings.xml | 4 -- .../legacy/src/main/res/values-sl/strings.xml | 4 -- .../legacy/src/main/res/values-sq/strings.xml | 4 -- .../legacy/src/main/res/values-sr/strings.xml | 4 -- .../legacy/src/main/res/values-sv/strings.xml | 4 -- .../legacy/src/main/res/values-tr/strings.xml | 4 -- .../legacy/src/main/res/values-uk/strings.xml | 4 -- .../src/main/res/values-zh-rCN/strings.xml | 4 -- .../src/main/res/values-zh-rTW/strings.xml | 4 -- app/ui/legacy/src/main/res/values/strings.xml | 5 +- .../src/main/res/xml/general_settings.xml | 42 +++----------- 54 files changed, 36 insertions(+), 292 deletions(-) diff --git a/app/core/src/main/java/com/fsck/k9/FontSizes.java b/app/core/src/main/java/com/fsck/k9/FontSizes.java index 9e80e62819..13632d8a6a 100644 --- a/app/core/src/main/java/com/fsck/k9/FontSizes.java +++ b/app/core/src/main/java/com/fsck/k9/FontSizes.java @@ -21,10 +21,7 @@ public class FontSizes { private static final String MESSAGE_LIST_DATE = "fontSizeMessageListDate"; private static final String MESSAGE_LIST_PREVIEW = "fontSizeMessageListPreview"; private static final String MESSAGE_VIEW_SENDER = "fontSizeMessageViewSender"; - private static final String MESSAGE_VIEW_TO = "fontSizeMessageViewTo"; - private static final String MESSAGE_VIEW_CC = "fontSizeMessageViewCC"; - private static final String MESSAGE_VIEW_BCC = "fontSizeMessageViewBCC"; - private static final String MESSAGE_VIEW_ADDITIONAL_HEADERS = "fontSizeMessageViewAdditionalHeaders"; + private static final String MESSAGE_VIEW_RECIPIENTS = "fontSizeMessageViewTo"; private static final String MESSAGE_VIEW_SUBJECT = "fontSizeMessageViewSubject"; private static final String MESSAGE_VIEW_DATE = "fontSizeMessageViewDate"; private static final String MESSAGE_VIEW_CONTENT_PERCENT = "fontSizeMessageViewContentPercent"; @@ -50,10 +47,7 @@ public class FontSizes { private int messageListDate; private int messageListPreview; private int messageViewSender; - private int messageViewTo; - private int messageViewCC; - private int messageViewBCC; - private int messageViewAdditionalHeaders; + private int messageViewRecipients; private int messageViewSubject; private int messageViewDate; private int messageViewContentPercent; @@ -73,10 +67,7 @@ public class FontSizes { messageListPreview = FONT_DEFAULT; messageViewSender = FONT_DEFAULT; - messageViewTo = FONT_DEFAULT; - messageViewCC = FONT_DEFAULT; - messageViewBCC = FONT_DEFAULT; - messageViewAdditionalHeaders = FONT_DEFAULT; + messageViewRecipients = FONT_DEFAULT; messageViewSubject = FONT_DEFAULT; messageViewDate = FONT_DEFAULT; messageViewContentPercent = 100; @@ -97,10 +88,7 @@ public class FontSizes { editor.putInt(MESSAGE_LIST_PREVIEW, messageListPreview); editor.putInt(MESSAGE_VIEW_SENDER, messageViewSender); - editor.putInt(MESSAGE_VIEW_TO, messageViewTo); - editor.putInt(MESSAGE_VIEW_CC, messageViewCC); - editor.putInt(MESSAGE_VIEW_BCC, messageViewBCC); - editor.putInt(MESSAGE_VIEW_ADDITIONAL_HEADERS, messageViewAdditionalHeaders); + editor.putInt(MESSAGE_VIEW_RECIPIENTS, messageViewRecipients); editor.putInt(MESSAGE_VIEW_SUBJECT, messageViewSubject); editor.putInt(MESSAGE_VIEW_DATE, messageViewDate); editor.putInt(MESSAGE_VIEW_CONTENT_PERCENT, getMessageViewContentAsPercent()); @@ -121,10 +109,7 @@ public class FontSizes { messageListPreview = storage.getInt(MESSAGE_LIST_PREVIEW, messageListPreview); messageViewSender = storage.getInt(MESSAGE_VIEW_SENDER, messageViewSender); - messageViewTo = storage.getInt(MESSAGE_VIEW_TO, messageViewTo); - messageViewCC = storage.getInt(MESSAGE_VIEW_CC, messageViewCC); - messageViewBCC = storage.getInt(MESSAGE_VIEW_BCC, messageViewBCC); - messageViewAdditionalHeaders = storage.getInt(MESSAGE_VIEW_ADDITIONAL_HEADERS, messageViewAdditionalHeaders); + messageViewRecipients = storage.getInt(MESSAGE_VIEW_RECIPIENTS, messageViewRecipients); messageViewSubject = storage.getInt(MESSAGE_VIEW_SUBJECT, messageViewSubject); messageViewDate = storage.getInt(MESSAGE_VIEW_DATE, messageViewDate); @@ -209,36 +194,12 @@ public class FontSizes { this.messageViewSender = messageViewSender; } - public int getMessageViewTo() { - return messageViewTo; + public int getMessageViewRecipients() { + return messageViewRecipients; } - public void setMessageViewTo(int messageViewTo) { - this.messageViewTo = messageViewTo; - } - - public int getMessageViewCC() { - return messageViewCC; - } - - public void setMessageViewCC(int messageViewCC) { - this.messageViewCC = messageViewCC; - } - - public int getMessageViewBCC() { - return messageViewBCC; - } - - public void setMessageViewBCC(int messageViewBCC) { - this.messageViewBCC = messageViewBCC; - } - - public int getMessageViewAdditionalHeaders() { - return messageViewAdditionalHeaders; - } - - public void setMessageViewAdditionalHeaders(int messageViewAdditionalHeaders) { - this.messageViewAdditionalHeaders = messageViewAdditionalHeaders; + public void setMessageViewRecipients(int messageViewRecipients) { + this.messageViewRecipients = messageViewRecipients; } public int getMessageViewSubject() { diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageListActivityConfig.kt b/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageListActivityConfig.kt index fc2ebd1ec5..1f910f91e1 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageListActivityConfig.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageListActivityConfig.kt @@ -26,10 +26,7 @@ data class MessageListActivityConfig( val fontSizeMessageListDate: Int, val fontSizeMessageListPreview: Int, val fontSizeMessageViewSender: Int, - val fontSizeMessageViewTo: Int, - val fontSizeMessageViewCC: Int, - val fontSizeMessageViewBCC: Int, - val fontSizeMessageViewAdditionalHeaders: Int, + val fontSizeMessageViewRecipients: Int, val fontSizeMessageViewSubject: Int, val fontSizeMessageViewDate: Int, val fontSizeMessageViewContentAsPercent: Int, @@ -60,10 +57,7 @@ data class MessageListActivityConfig( fontSizeMessageListDate = K9.fontSizes.messageListDate, fontSizeMessageListPreview = K9.fontSizes.messageListPreview, fontSizeMessageViewSender = K9.fontSizes.messageViewSender, - fontSizeMessageViewTo = K9.fontSizes.messageViewTo, - fontSizeMessageViewCC = K9.fontSizes.messageViewCC, - fontSizeMessageViewBCC = K9.fontSizes.messageViewBCC, - fontSizeMessageViewAdditionalHeaders = K9.fontSizes.messageViewAdditionalHeaders, + fontSizeMessageViewRecipients = K9.fontSizes.messageViewRecipients, fontSizeMessageViewSubject = K9.fontSizes.messageViewSubject, fontSizeMessageViewDate = K9.fontSizes.messageViewDate, fontSizeMessageViewContentAsPercent = K9.fontSizes.messageViewContentAsPercent, diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/general/GeneralSettingsDataStore.kt b/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/general/GeneralSettingsDataStore.kt index 6e1ae5a9c4..385889aef1 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/general/GeneralSettingsDataStore.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/general/GeneralSettingsDataStore.kt @@ -119,12 +119,9 @@ class GeneralSettingsDataStore( "message_list_date_font" -> K9.fontSizes.messageListDate.toString() "message_list_preview_font" -> K9.fontSizes.messageListPreview.toString() "message_view_sender_font" -> K9.fontSizes.messageViewSender.toString() - "message_view_to_font" -> K9.fontSizes.messageViewTo.toString() - "message_view_cc_font" -> K9.fontSizes.messageViewCC.toString() - "message_view_bcc_font" -> K9.fontSizes.messageViewBCC.toString() + "message_view_recipients_font" -> K9.fontSizes.messageViewRecipients.toString() "message_view_subject_font" -> K9.fontSizes.messageViewSubject.toString() "message_view_date_font" -> K9.fontSizes.messageViewDate.toString() - "message_view_additional_headers_font" -> K9.fontSizes.messageViewAdditionalHeaders.toString() "message_compose_input_font" -> K9.fontSizes.messageComposeInput.toString() "swipe_action_right" -> swipeActionToString(K9.swipeRightAction) "swipe_action_left" -> swipeActionToString(K9.swipeLeftAction) @@ -160,12 +157,9 @@ class GeneralSettingsDataStore( "message_list_date_font" -> K9.fontSizes.messageListDate = value.toInt() "message_list_preview_font" -> K9.fontSizes.messageListPreview = value.toInt() "message_view_sender_font" -> K9.fontSizes.messageViewSender = value.toInt() - "message_view_to_font" -> K9.fontSizes.messageViewTo = value.toInt() - "message_view_cc_font" -> K9.fontSizes.messageViewCC = value.toInt() - "message_view_bcc_font" -> K9.fontSizes.messageViewBCC = value.toInt() + "message_view_recipients_font" -> K9.fontSizes.messageViewRecipients = value.toInt() "message_view_subject_font" -> K9.fontSizes.messageViewSubject = value.toInt() "message_view_date_font" -> K9.fontSizes.messageViewDate = value.toInt() - "message_view_additional_headers_font" -> K9.fontSizes.messageViewAdditionalHeaders = value.toInt() "message_compose_input_font" -> K9.fontSizes.messageComposeInput = value.toInt() "swipe_action_right" -> K9.swipeRightAction = stringToSwipeAction(value) "swipe_action_left" -> K9.swipeLeftAction = stringToSwipeAction(value) diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java b/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java index 238ba03327..94afcd61d5 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java +++ b/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java @@ -17,6 +17,7 @@ import androidx.appcompat.widget.PopupMenu; import androidx.appcompat.widget.PopupMenu.OnMenuItemClickListener; import com.fsck.k9.Account; import com.fsck.k9.DI; +import com.fsck.k9.FontSizes; import com.fsck.k9.K9; import com.fsck.k9.activity.misc.ContactPicture; import com.fsck.k9.contacts.ContactPictureLoader; @@ -34,12 +35,16 @@ import com.google.android.material.snackbar.Snackbar; public class MessageHeader extends LinearLayout implements OnClickListener, OnLongClickListener { private static final int DEFAULT_SUBJECT_LINES = 3; + private final FontSizes fontSizes = K9.getFontSizes(); + private Chip accountChip; private TextView subjectView; private ImageView starView; private ImageView contactPictureView; private TextView fromView; private ImageView cryptoStatusIcon; + private TextView toView; + private TextView toCountView; private TextView dateView; private MessageHelper messageHelper; @@ -67,8 +72,16 @@ public class MessageHeader extends LinearLayout implements OnClickListener, OnLo contactPictureView = findViewById(R.id.contact_picture); fromView = findViewById(R.id.from); cryptoStatusIcon = findViewById(R.id.crypto_status_icon); + toView = findViewById(R.id.to); + toCountView = findViewById(R.id.to_count); dateView = findViewById(R.id.date); + fontSizes.setViewTextSize(subjectView, fontSizes.getMessageViewSubject()); + fontSizes.setViewTextSize(dateView, fontSizes.getMessageViewDate()); + fontSizes.setViewTextSize(fromView, fontSizes.getMessageViewSender()); + fontSizes.setViewTextSize(toView, fontSizes.getMessageViewRecipients()); + fontSizes.setViewTextSize(toCountView, fontSizes.getMessageViewRecipients()); + subjectView.setOnClickListener(this); subjectView.setOnLongClickListener(this); diff --git a/app/ui/legacy/src/main/res/values-ar/strings.xml b/app/ui/legacy/src/main/res/values-ar/strings.xml index ea33024ac6..539cee7185 100644 --- a/app/ui/legacy/src/main/res/values-ar/strings.xml +++ b/app/ui/legacy/src/main/res/values-ar/strings.xml @@ -605,9 +605,6 @@ معاينة رسائل مُرسِل - إلى - نسخة - ترويسات إضافية العنوان الوقت والتاريخ نصّ الرسالة diff --git a/app/ui/legacy/src/main/res/values-be/strings.xml b/app/ui/legacy/src/main/res/values-be/strings.xml index eba907b606..35f374e092 100644 --- a/app/ui/legacy/src/main/res/values-be/strings.xml +++ b/app/ui/legacy/src/main/res/values-be/strings.xml @@ -668,10 +668,6 @@ K-9 Mail - шматфункцыянальны свабодны паштовы к Папярэдні прагляд Паведамленне Адпраўнік - Каму - Копія - Схаваная копія - Дадатковыя загалоўкі Тэма Час і дата Цела ліста diff --git a/app/ui/legacy/src/main/res/values-bg/strings.xml b/app/ui/legacy/src/main/res/values-bg/strings.xml index 17e2572fe3..b2b4ab11cf 100644 --- a/app/ui/legacy/src/main/res/values-bg/strings.xml +++ b/app/ui/legacy/src/main/res/values-bg/strings.xml @@ -665,10 +665,6 @@ K-9 Mail е мощен, безплатен имейл клиент за Андр Преглед Съобщения Изпращач - До - Cc - Bcc - Допълнителни header-и Тема Дата и час Тяло на съобщението diff --git a/app/ui/legacy/src/main/res/values-br/strings.xml b/app/ui/legacy/src/main/res/values-br/strings.xml index 6b8e2340a9..e2caa559dd 100644 --- a/app/ui/legacy/src/main/res/values-br/strings.xml +++ b/app/ui/legacy/src/main/res/values-br/strings.xml @@ -636,10 +636,6 @@ Danevellit beugoù, kenlabourit war keweriusterioù nevez ha savit goulennoù wa Alberz Kemennadennoù Kaser - Da - Cc - Bcc - Talbennoù ouzhpenn Danvez Eur ha deiziad Korf ar gemennadenn diff --git a/app/ui/legacy/src/main/res/values-ca/strings.xml b/app/ui/legacy/src/main/res/values-ca/strings.xml index 9ba2ceae10..15a6b7ebb9 100644 --- a/app/ui/legacy/src/main/res/values-ca/strings.xml +++ b/app/ui/legacy/src/main/res/values-ca/strings.xml @@ -730,10 +730,6 @@ Si us plau, envieu informes d\'errors, contribuïu-hi amb noves millores i feu p Vista prèvia Missatges Remitent - A - A/c - C/o - Capçaleres addicionals Assumpte Data i hora Cos del missatge diff --git a/app/ui/legacy/src/main/res/values-cs/strings.xml b/app/ui/legacy/src/main/res/values-cs/strings.xml index f480a72be5..d8d54e58a5 100644 --- a/app/ui/legacy/src/main/res/values-cs/strings.xml +++ b/app/ui/legacy/src/main/res/values-cs/strings.xml @@ -727,10 +727,6 @@ Hlášení o chyb, úpravy pro nové funkce a dotazy zadávejte prostřednictví Náhled Zpráva Odesílatel - Příjemce (Komu) - Příjemce (Kopie) - Skrytá kopie - Další záhlaví Předmět Datum a čas Tělo diff --git a/app/ui/legacy/src/main/res/values-cy/strings.xml b/app/ui/legacy/src/main/res/values-cy/strings.xml index e16f5757bb..5c543f2c86 100644 --- a/app/ui/legacy/src/main/res/values-cy/strings.xml +++ b/app/ui/legacy/src/main/res/values-cy/strings.xml @@ -729,10 +729,6 @@ Plîs rho wybod am unrhyw wallau, syniadau am nodweddion newydd, neu ofyn cwesti Rhagolwg Negeseuon Anfonwr - At - Cc - Bcc - Penynnau ychwanegol Pwnc Amser a dyddiad Corff neges diff --git a/app/ui/legacy/src/main/res/values-da/strings.xml b/app/ui/legacy/src/main/res/values-da/strings.xml index 15c4258686..2ef14c6e21 100644 --- a/app/ui/legacy/src/main/res/values-da/strings.xml +++ b/app/ui/legacy/src/main/res/values-da/strings.xml @@ -694,10 +694,6 @@ Rapporter venligst fejl, forslag til nye funktioner eller stil spørgsmål på: Forhåndsvisning Meddelelse Afsender - Modtagere (Til) - Modtagere (Cc) - Bcc - Yderligere headere Emne Tid og dato Indhold diff --git a/app/ui/legacy/src/main/res/values-de/strings.xml b/app/ui/legacy/src/main/res/values-de/strings.xml index 1dbb9674a4..bcf2c2e5bc 100644 --- a/app/ui/legacy/src/main/res/values-de/strings.xml +++ b/app/ui/legacy/src/main/res/values-de/strings.xml @@ -730,10 +730,6 @@ Bitte senden Sie Fehlerberichte, Ideen für neue Funktionen und stellen Sie Frag Vorschau Nachrichtenanzeige Absender - Empfänger (To) - Empfänger (CC) - Blindkopie (BCC) - Zusätzliche Header Betreff Uhrzeit und Datum Nachrichtentext diff --git a/app/ui/legacy/src/main/res/values-el/strings.xml b/app/ui/legacy/src/main/res/values-el/strings.xml index 8337b1efac..dc43531530 100644 --- a/app/ui/legacy/src/main/res/values-el/strings.xml +++ b/app/ui/legacy/src/main/res/values-el/strings.xml @@ -725,10 +725,6 @@ Προεπισκόπηση Μηνύματα Αποστολέας - Προς - Κοινοποίηση - Κρυφή Κοιν: - Επιπλέον επικεφαλίδες Θέμα Ώρα και Ημερομηνία Σώμα μηνύματος diff --git a/app/ui/legacy/src/main/res/values-eo/strings.xml b/app/ui/legacy/src/main/res/values-eo/strings.xml index 42355790e3..7e8bb9fa82 100644 --- a/app/ui/legacy/src/main/res/values-eo/strings.xml +++ b/app/ui/legacy/src/main/res/values-eo/strings.xml @@ -683,10 +683,6 @@ Bonvolu raporti erarojn, kontribui novajn eblojn kaj peti pri novaj funkcioj per Antaŭmontro Mesaĝoj Sendinto - Ricevonto - Ricevonto de kopio - Kaŝkopio - Aldonaj kapoj Temo Tempo kaj dato Mesaĝa enhavo diff --git a/app/ui/legacy/src/main/res/values-es/strings.xml b/app/ui/legacy/src/main/res/values-es/strings.xml index 2b785a6f0e..ca3d045179 100644 --- a/app/ui/legacy/src/main/res/values-es/strings.xml +++ b/app/ui/legacy/src/main/res/values-es/strings.xml @@ -730,10 +730,6 @@ Puedes informar de fallos, contribuir con su desarrollo y hacer preguntas en Previsualizar Mensajes Remitente - Para - Cc - Cco - Encabezados adicionales Asunto Hora y fecha Cuerpo de mensaje diff --git a/app/ui/legacy/src/main/res/values-et/strings.xml b/app/ui/legacy/src/main/res/values-et/strings.xml index 36f0b1cca3..ede6d328ee 100644 --- a/app/ui/legacy/src/main/res/values-et/strings.xml +++ b/app/ui/legacy/src/main/res/values-et/strings.xml @@ -726,10 +726,6 @@ Veateated saad saata, kaastööd teha ning küsida teavet järgmisel lehel: Eelvaade Kirjad Saatja - Kellele - Koopia - Pimekoopia - Täiendavad pealkirjad Teema Kellaaeg ja kuupäev Kirja põhiosa diff --git a/app/ui/legacy/src/main/res/values-eu/strings.xml b/app/ui/legacy/src/main/res/values-eu/strings.xml index 78bafc4988..109baefa2d 100644 --- a/app/ui/legacy/src/main/res/values-eu/strings.xml +++ b/app/ui/legacy/src/main/res/values-eu/strings.xml @@ -729,10 +729,6 @@ Mesedez akatsen berri emateko, ezaugarri berriak gehitzeko eta galderak egiteko Aurreikusi Mezuak Bidaltzailea - Nori - Cc - Bcc - Goiburu osagarriak Gaia Ordua eta data Mezuaren gorputza diff --git a/app/ui/legacy/src/main/res/values-fa/strings.xml b/app/ui/legacy/src/main/res/values-fa/strings.xml index 08bfd2eb45..66f211d6e1 100644 --- a/app/ui/legacy/src/main/res/values-fa/strings.xml +++ b/app/ui/legacy/src/main/res/values-fa/strings.xml @@ -723,10 +723,6 @@ پیش‌نمایش پیام‌ها فرستنده - به - رونوشت به - مخفیانه به - سرایندهای اضافی موضوع ساعت و تاریخ متن پیام diff --git a/app/ui/legacy/src/main/res/values-fi/strings.xml b/app/ui/legacy/src/main/res/values-fi/strings.xml index c5ba53382e..3cd5aae68f 100644 --- a/app/ui/legacy/src/main/res/values-fi/strings.xml +++ b/app/ui/legacy/src/main/res/values-fi/strings.xml @@ -729,10 +729,6 @@ Ilmoita virheistä, ota osaa sovelluskehitykseen ja esitä kysymyksiä osoittees Esikatselu Viestinäkymä Lähettäjä - Vastaanottaja - Kopio - Piilokopio - Tarkemmat otsikkotiedot Viestin aihe Aika ja päivämäärä Viestin sisältö diff --git a/app/ui/legacy/src/main/res/values-fr/strings.xml b/app/ui/legacy/src/main/res/values-fr/strings.xml index b758d68eef..0d3ba86c15 100644 --- a/app/ui/legacy/src/main/res/values-fr/strings.xml +++ b/app/ui/legacy/src/main/res/values-fr/strings.xml @@ -733,10 +733,6 @@ Rapportez les bogues, recommandez de nouvelles fonctions et posez vos questions Aperçu Courriels Expéditeur - À - Cc - Cci - En-têtes supplémentaires Objet Horodatage Corps du courriel diff --git a/app/ui/legacy/src/main/res/values-fy/strings.xml b/app/ui/legacy/src/main/res/values-fy/strings.xml index f8b9189fe6..c436f3d2ca 100644 --- a/app/ui/legacy/src/main/res/values-fy/strings.xml +++ b/app/ui/legacy/src/main/res/values-fy/strings.xml @@ -725,10 +725,6 @@ Graach flaterrapporten stjoere, bydragen foar nije funksjes en fragen stelle op Foarbyld Berjochten Ofstjoerder - Oan - Cc - Bcc - Ekstra koppen Underwerp Tiid en datum Berichtynhâld diff --git a/app/ui/legacy/src/main/res/values-gd/strings.xml b/app/ui/legacy/src/main/res/values-gd/strings.xml index 2874a726d8..ce0ec1a2bf 100644 --- a/app/ui/legacy/src/main/res/values-gd/strings.xml +++ b/app/ui/legacy/src/main/res/values-gd/strings.xml @@ -631,10 +631,6 @@ Ro-shealladh Teachdaireachdan Seòladair - Gu - Cc - Bcc - Bannan-cinn a bharrachd Cuspair Ceann-là ’s àm Bodhaig na teachdaireachd diff --git a/app/ui/legacy/src/main/res/values-gl-rES/strings.xml b/app/ui/legacy/src/main/res/values-gl-rES/strings.xml index a8e9c40719..9cf98da8ef 100644 --- a/app/ui/legacy/src/main/res/values-gl-rES/strings.xml +++ b/app/ui/legacy/src/main/res/values-gl-rES/strings.xml @@ -536,10 +536,6 @@ Previsualización Mensaxes Remitente - Para - Cc - Bcc - Cabeceiras adicionais Asunto Hora e data Corpo da mensaxe diff --git a/app/ui/legacy/src/main/res/values-gl/strings.xml b/app/ui/legacy/src/main/res/values-gl/strings.xml index 44e9ac4c48..82b4c8fbd7 100644 --- a/app/ui/legacy/src/main/res/values-gl/strings.xml +++ b/app/ui/legacy/src/main/res/values-gl/strings.xml @@ -689,10 +689,6 @@ Por favor envíen informes de fallos, contribúa con novas características e co Vista previa mensaxes Remitente - Para - Cc - CCo - Encabezados adicionáis Asunto Data e Hora Corpo da mensaxe diff --git a/app/ui/legacy/src/main/res/values-hr/strings.xml b/app/ui/legacy/src/main/res/values-hr/strings.xml index 64a0ad4529..1336645ec3 100644 --- a/app/ui/legacy/src/main/res/values-hr/strings.xml +++ b/app/ui/legacy/src/main/res/values-hr/strings.xml @@ -627,10 +627,6 @@ Pedpregled Poruke Pošiljatelj - Za - Cc - Bcc - Dodatna zaglavlja Subjekt Vrijeme i datum Tijelo poruke diff --git a/app/ui/legacy/src/main/res/values-hu/strings.xml b/app/ui/legacy/src/main/res/values-hu/strings.xml index 7066a303f9..13c5d0c8ae 100644 --- a/app/ui/legacy/src/main/res/values-hu/strings.xml +++ b/app/ui/legacy/src/main/res/values-hu/strings.xml @@ -721,10 +721,6 @@ Hibajelentések beküldésével közreműködhet az új funkciókban, és kérd Előnézet Üzenetek Feladó - Címzett - Másolat - Titkos másolat - További fejlécek Tárgy Idő és dátum Üzenet törzse diff --git a/app/ui/legacy/src/main/res/values-in/strings.xml b/app/ui/legacy/src/main/res/values-in/strings.xml index 255b93aade..4a553e68ef 100644 --- a/app/ui/legacy/src/main/res/values-in/strings.xml +++ b/app/ui/legacy/src/main/res/values-in/strings.xml @@ -663,10 +663,6 @@ Kirimkan laporan bug, kontribusikan fitur baru dan ajukan pertanyaan di Pratinjau Pesan Pengirim - Kepada - Cc - Bcc - Header tambahan Subyek Tanggal dan waktu Isi pesan diff --git a/app/ui/legacy/src/main/res/values-is/strings.xml b/app/ui/legacy/src/main/res/values-is/strings.xml index 8b1c35ce71..ace513045a 100644 --- a/app/ui/legacy/src/main/res/values-is/strings.xml +++ b/app/ui/legacy/src/main/res/values-is/strings.xml @@ -724,10 +724,6 @@ Sendu inn villuskýrslur, leggðu fram nýja eiginleika og spurðu spurninga á Forskoðun Skilaboð Sendandi - Til - Afrit - Falið afrit - Viðbótarhausar Viðfangsefni Tími og dagsetning Efni skilaboða diff --git a/app/ui/legacy/src/main/res/values-it/strings.xml b/app/ui/legacy/src/main/res/values-it/strings.xml index 0de163288d..2655c6cabd 100644 --- a/app/ui/legacy/src/main/res/values-it/strings.xml +++ b/app/ui/legacy/src/main/res/values-it/strings.xml @@ -726,10 +726,6 @@ Invia segnalazioni di bug, contribuisci con nuove funzionalità e poni domande s Anteprima Messaggi Mittente - A - Cc - Ccn - Intestazioni aggiuntive Oggetto Ora e data Corpo del messaggio diff --git a/app/ui/legacy/src/main/res/values-iw/strings.xml b/app/ui/legacy/src/main/res/values-iw/strings.xml index db44e38f69..7ccf3756e7 100644 --- a/app/ui/legacy/src/main/res/values-iw/strings.xml +++ b/app/ui/legacy/src/main/res/values-iw/strings.xml @@ -538,10 +538,6 @@ תצוגה מקדימה הודעות שולח - ל - עותק - עותק מוסתר - כותרות נוספות כותרת שעה ותאריך גוף ההודעה diff --git a/app/ui/legacy/src/main/res/values-ja/strings.xml b/app/ui/legacy/src/main/res/values-ja/strings.xml index 6d814e65e9..9d9cd5277a 100644 --- a/app/ui/legacy/src/main/res/values-ja/strings.xml +++ b/app/ui/legacy/src/main/res/values-ja/strings.xml @@ -728,10 +728,6 @@ K-9 は大多数のメールクライアントと同様に、ほとんどのフ プレビュー メッセージ表示 送信者 - To - CC - Bcc - 追加ヘッダ 件名 日時 本文 diff --git a/app/ui/legacy/src/main/res/values-ko/strings.xml b/app/ui/legacy/src/main/res/values-ko/strings.xml index e2e0f709e9..05269ca21f 100644 --- a/app/ui/legacy/src/main/res/values-ko/strings.xml +++ b/app/ui/legacy/src/main/res/values-ko/strings.xml @@ -579,10 +579,6 @@ 미리 보기 메시지 보낸이 - 받는이 - 참조 - 숨은 참조 - 추가 헤더 정보 제목 시간 및 날짜 내용 diff --git a/app/ui/legacy/src/main/res/values-lt/strings.xml b/app/ui/legacy/src/main/res/values-lt/strings.xml index ca9b1384d2..99c71c5473 100644 --- a/app/ui/legacy/src/main/res/values-lt/strings.xml +++ b/app/ui/legacy/src/main/res/values-lt/strings.xml @@ -722,10 +722,6 @@ Pateikite pranešimus apie klaidas, prisidėkite prie naujų funkcijų kūrimo i Peržiūra Laiškai Siuntėjas - Kam - Cc - Slapta kopija - Papildomos antraštės Tema Laikas ir data Pagrindinė laiško dalis diff --git a/app/ui/legacy/src/main/res/values-lv/strings.xml b/app/ui/legacy/src/main/res/values-lv/strings.xml index ccd3112474..c5cb9e909c 100644 --- a/app/ui/legacy/src/main/res/values-lv/strings.xml +++ b/app/ui/legacy/src/main/res/values-lv/strings.xml @@ -690,10 +690,6 @@ pat %d vairāk Priekšskatījums Vēstules Sūtītājs - Kam - Cc - Neredzamais - Izvērsta vēstules papildinformācija Temats Laiks un datums Vēstules pamatteksts diff --git a/app/ui/legacy/src/main/res/values-ml/strings.xml b/app/ui/legacy/src/main/res/values-ml/strings.xml index bfd3982118..020564612c 100644 --- a/app/ui/legacy/src/main/res/values-ml/strings.xml +++ b/app/ui/legacy/src/main/res/values-ml/strings.xml @@ -691,10 +691,6 @@ പ്രിവ്യൂ സന്ദേശങ്ങൾ അയച്ചയാൾ - To - Cc - Bcc - അധിക തലക്കെട്ടുകൾ വിഷയം സമയവും തീയതിയും സന്ദേശ ബോഡി diff --git a/app/ui/legacy/src/main/res/values-nb/strings.xml b/app/ui/legacy/src/main/res/values-nb/strings.xml index d2a64cd6b8..a0ed2e0acb 100644 --- a/app/ui/legacy/src/main/res/values-nb/strings.xml +++ b/app/ui/legacy/src/main/res/values-nb/strings.xml @@ -662,10 +662,6 @@ til %d flere Forhåndsvisning Meldinger Avsender - Til - Kopi - Blindkopi - Flere meldingshoder Emne Tid og dato Meldingstekst diff --git a/app/ui/legacy/src/main/res/values-nl/strings.xml b/app/ui/legacy/src/main/res/values-nl/strings.xml index 0d49caafb6..c1b9c930a1 100644 --- a/app/ui/legacy/src/main/res/values-nl/strings.xml +++ b/app/ui/legacy/src/main/res/values-nl/strings.xml @@ -725,10 +725,6 @@ Graag foutrapporten sturen, bijdragen voor nieuwe functies en vragen stellen op Voorbeeld Berichten Afzender - Bericht ontvanger (Aan) - Bericht ontvanger (CC) - Bericht ontvanger (BCC) - Extra koppen Onderwerp Tijd en datum Berichtinhoud diff --git a/app/ui/legacy/src/main/res/values-pl/strings.xml b/app/ui/legacy/src/main/res/values-pl/strings.xml index 6dfcd3bf70..c53c86e1dc 100644 --- a/app/ui/legacy/src/main/res/values-pl/strings.xml +++ b/app/ui/legacy/src/main/res/values-pl/strings.xml @@ -734,10 +734,6 @@ Wysłane z urządzenia Android za pomocą K-9 Mail. Proszę wybaczyć moją zwi Podgląd Wiadomości Nadawca - Adresat (Do:) - Odbiorca kopii (DW:) - UDW - Dodatkowe nagłówki Temat Czas i data Treść wiadomości diff --git a/app/ui/legacy/src/main/res/values-pt-rBR/strings.xml b/app/ui/legacy/src/main/res/values-pt-rBR/strings.xml index bb1ab6a5c0..f4c7c76fde 100644 --- a/app/ui/legacy/src/main/res/values-pt-rBR/strings.xml +++ b/app/ui/legacy/src/main/res/values-pt-rBR/strings.xml @@ -731,10 +731,6 @@ Por favor encaminhe relatórios de bugs, contribua com novos recursos e tire dú Visualização Mensagens Remetente - Para - Cc - Cco - Cabeçalhos adicionais Assunto Data e hora Corpo da mensagem diff --git a/app/ui/legacy/src/main/res/values-pt-rPT/strings.xml b/app/ui/legacy/src/main/res/values-pt-rPT/strings.xml index 0ea4b36c05..78eacc04bc 100644 --- a/app/ui/legacy/src/main/res/values-pt-rPT/strings.xml +++ b/app/ui/legacy/src/main/res/values-pt-rPT/strings.xml @@ -718,10 +718,6 @@ Por favor envie relatórios de falhas, contribua com novas funcionalidades e col Pré-visualização Mensagens Remetente - Para - Cc - Bcc - Cabeçalhos adicionais Assunto Data e hora Corpo da mensagem diff --git a/app/ui/legacy/src/main/res/values-ro/strings.xml b/app/ui/legacy/src/main/res/values-ro/strings.xml index 1ead48d202..ef0286ef0b 100644 --- a/app/ui/legacy/src/main/res/values-ro/strings.xml +++ b/app/ui/legacy/src/main/res/values-ro/strings.xml @@ -728,10 +728,6 @@ Uneori datorită faptului că cineva încearcă să te atace pe tine sau serveru Previzualizare Mesaje Expeditor - Către - Cc - Bcc - Antete adiționale Subiect Timp și dată Conținut mesaj diff --git a/app/ui/legacy/src/main/res/values-ru/strings.xml b/app/ui/legacy/src/main/res/values-ru/strings.xml index bcade6a6c7..de5870c6eb 100644 --- a/app/ui/legacy/src/main/res/values-ru/strings.xml +++ b/app/ui/legacy/src/main/res/values-ru/strings.xml @@ -733,10 +733,6 @@ K-9 Mail — почтовый клиент для Android. Просмотр Сообщение Отправитель - Кому - Копия - Скрытая - Все заголовки Тема Дата и время Тело сообщения diff --git a/app/ui/legacy/src/main/res/values-sk/strings.xml b/app/ui/legacy/src/main/res/values-sk/strings.xml index 8eb5d1d2e9..e733d27a85 100644 --- a/app/ui/legacy/src/main/res/values-sk/strings.xml +++ b/app/ui/legacy/src/main/res/values-sk/strings.xml @@ -669,10 +669,6 @@ Prosím, nahlasujte prípadné chyby, prispievajte novými funkciami a pýtajte Náhľad Správy Odosielateľ - Komu - Kópia - Skrytá kópia - Prídavné hlavičky Skrytá kópia Čas a dátum Telo správy diff --git a/app/ui/legacy/src/main/res/values-sl/strings.xml b/app/ui/legacy/src/main/res/values-sl/strings.xml index 782ec54963..1792198078 100644 --- a/app/ui/legacy/src/main/res/values-sl/strings.xml +++ b/app/ui/legacy/src/main/res/values-sl/strings.xml @@ -727,10 +727,6 @@ dodatnih %d sporočil Predogled Sporočila Pošiljatelj - Za - Kp - Skp - Dodatni zapisi glave Zadeva Čas in datum Telo sporočila diff --git a/app/ui/legacy/src/main/res/values-sq/strings.xml b/app/ui/legacy/src/main/res/values-sq/strings.xml index 71843b095e..048afc9341 100644 --- a/app/ui/legacy/src/main/res/values-sq/strings.xml +++ b/app/ui/legacy/src/main/res/values-sq/strings.xml @@ -729,10 +729,6 @@ Ju lutemi, parashtrim njoftimesh për të meta, kontribute për veçori të reaj Paraparje Mesazhe Dërgues - Për - Cc - Bcc - Krye shtesë Subjekt Kohë dhe datë Trup i mesazhit diff --git a/app/ui/legacy/src/main/res/values-sr/strings.xml b/app/ui/legacy/src/main/res/values-sr/strings.xml index 01a1f7faae..09195b4579 100644 --- a/app/ui/legacy/src/main/res/values-sr/strings.xml +++ b/app/ui/legacy/src/main/res/values-sr/strings.xml @@ -667,10 +667,6 @@ Преглед Поруке Пошиљалац - За - Коп - СКоп - Додатна заглавља Тема Време и датум Тело поруке diff --git a/app/ui/legacy/src/main/res/values-sv/strings.xml b/app/ui/legacy/src/main/res/values-sv/strings.xml index 03eb42d3d5..814e08a979 100644 --- a/app/ui/legacy/src/main/res/values-sv/strings.xml +++ b/app/ui/legacy/src/main/res/values-sv/strings.xml @@ -730,10 +730,6 @@ Skicka in felrapporter, bidra med nya funktioner och ställ frågor på Förhandsgranskning Meddelanden Avsändare - Till - Kopia - Blindkopia - Ytterligare meddelanderubriker Ämne Tid och datum Innehåll diff --git a/app/ui/legacy/src/main/res/values-tr/strings.xml b/app/ui/legacy/src/main/res/values-tr/strings.xml index ffe13fecd8..b3407491a9 100644 --- a/app/ui/legacy/src/main/res/values-tr/strings.xml +++ b/app/ui/legacy/src/main/res/values-tr/strings.xml @@ -705,10 +705,6 @@ Microsoft Exchange ile konuşurken bazı tuhaflıklar yaşadığını not ediniz Önizleme Mesajlar Gönderen - Kime - Bilgi - Gizli Kopya - Ek başlıklar Konu Saat ve Tarih Mesaj gövdesi diff --git a/app/ui/legacy/src/main/res/values-uk/strings.xml b/app/ui/legacy/src/main/res/values-uk/strings.xml index 58f3149f89..bb0ea4692b 100644 --- a/app/ui/legacy/src/main/res/values-uk/strings.xml +++ b/app/ui/legacy/src/main/res/values-uk/strings.xml @@ -728,10 +728,6 @@ K-9 Mail — це вільний клієнт електронної пошти Попередній перегляд Повідомлення Відправник - Кому - Копія - Прихована копія - Додаткові заголовки Тема Час і дата Тіло повідомлення diff --git a/app/ui/legacy/src/main/res/values-zh-rCN/strings.xml b/app/ui/legacy/src/main/res/values-zh-rCN/strings.xml index 42b68edb10..62db4aa005 100644 --- a/app/ui/legacy/src/main/res/values-zh-rCN/strings.xml +++ b/app/ui/legacy/src/main/res/values-zh-rCN/strings.xml @@ -728,10 +728,6 @@ K-9 Mail 是 Android 上一款功能强大的免费邮件客户端。 预览 邮件 发件人 - 收件人 - 抄送 - 秘送 - 额外的邮件信息 主题 日期 邮件内容 diff --git a/app/ui/legacy/src/main/res/values-zh-rTW/strings.xml b/app/ui/legacy/src/main/res/values-zh-rTW/strings.xml index 26f5db4e7b..ac111b2ac9 100644 --- a/app/ui/legacy/src/main/res/values-zh-rTW/strings.xml +++ b/app/ui/legacy/src/main/res/values-zh-rTW/strings.xml @@ -721,10 +721,6 @@ K-9 Mail 是 Android 上一款功能強大,免費的電子郵件用戶端。 預覽 郵件 寄件人 - 收件人 - 副本 - 密件副本 - 額外的郵件訊息 主題 日期 郵件本文內容 diff --git a/app/ui/legacy/src/main/res/values/strings.xml b/app/ui/legacy/src/main/res/values/strings.xml index ecc655b2f8..eba18a8897 100644 --- a/app/ui/legacy/src/main/res/values/strings.xml +++ b/app/ui/legacy/src/main/res/values/strings.xml @@ -876,10 +876,7 @@ Please submit bug reports, contribute new features and ask questions at Messages Sender - To - Cc - Bcc - Additional headers + Recipients Subject Time and date Message body diff --git a/app/ui/legacy/src/main/res/xml/general_settings.xml b/app/ui/legacy/src/main/res/xml/general_settings.xml index ebc9be2bd3..13e01248f7 100644 --- a/app/ui/legacy/src/main/res/xml/general_settings.xml +++ b/app/ui/legacy/src/main/res/xml/general_settings.xml @@ -149,44 +149,20 @@ android:key="message_view_fonts"> - - - - - - + android:dialogTitle="@string/font_size_message_view_subject" /> + android:dialogTitle="@string/font_size_message_view_sender" /> + android:dialogTitle="@string/font_size_message_view_recipients" /> Date: Mon, 21 Nov 2022 14:28:32 +0100 Subject: [PATCH 11/41] Add "line of death" --- app/ui/legacy/src/main/res/layout/message.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/ui/legacy/src/main/res/layout/message.xml b/app/ui/legacy/src/main/res/layout/message.xml index 4d8f1f43d9..ef38a18c1e 100644 --- a/app/ui/legacy/src/main/res/layout/message.xml +++ b/app/ui/legacy/src/main/res/layout/message.xml @@ -39,6 +39,11 @@ android:visibility="gone" tools:visibility="visible"/> + + Date: Mon, 21 Nov 2022 15:56:04 +0100 Subject: [PATCH 12/41] Add `ReplyActionStrategy` to figure out which reply actions are available to the user --- .../fsck/k9/message/ReplyActionStrategy.kt | 36 ++++++ .../k9/message/ReplyActionStrategyTest.kt | 111 ++++++++++++++++++ 2 files changed, 147 insertions(+) create mode 100644 app/core/src/main/java/com/fsck/k9/message/ReplyActionStrategy.kt create mode 100644 app/core/src/test/java/com/fsck/k9/message/ReplyActionStrategyTest.kt diff --git a/app/core/src/main/java/com/fsck/k9/message/ReplyActionStrategy.kt b/app/core/src/main/java/com/fsck/k9/message/ReplyActionStrategy.kt new file mode 100644 index 0000000000..a208b98209 --- /dev/null +++ b/app/core/src/main/java/com/fsck/k9/message/ReplyActionStrategy.kt @@ -0,0 +1,36 @@ +package com.fsck.k9.message + +import com.fsck.k9.Account +import com.fsck.k9.helper.ReplyToParser +import com.fsck.k9.mail.Message + +/** + * Figures out which reply actions are available to the user. + */ +class ReplyActionStrategy(private val replyRoParser: ReplyToParser) { + fun getReplyActions(account: Account, message: Message): ReplyActions { + val recipientsToReplyTo = replyRoParser.getRecipientsToReplyTo(message, account) + val recipientsToReplyAllTo = replyRoParser.getRecipientsToReplyAllTo(message, account) + + val replyToAllCount = recipientsToReplyAllTo.to.size + recipientsToReplyAllTo.cc.size + return if (replyToAllCount <= 1) { + if (recipientsToReplyTo.to.isEmpty()) { + ReplyActions(defaultAction = null) + } else { + ReplyActions(defaultAction = ReplyAction.REPLY) + } + } else { + ReplyActions(defaultAction = ReplyAction.REPLY_ALL, additionalActions = listOf(ReplyAction.REPLY)) + } + } +} + +data class ReplyActions( + val defaultAction: ReplyAction?, + val additionalActions: List = emptyList() +) + +enum class ReplyAction { + REPLY, + REPLY_ALL +} diff --git a/app/core/src/test/java/com/fsck/k9/message/ReplyActionStrategyTest.kt b/app/core/src/test/java/com/fsck/k9/message/ReplyActionStrategyTest.kt new file mode 100644 index 0000000000..e366859072 --- /dev/null +++ b/app/core/src/test/java/com/fsck/k9/message/ReplyActionStrategyTest.kt @@ -0,0 +1,111 @@ +package com.fsck.k9.message + +import com.fsck.k9.Account +import com.fsck.k9.Identity +import com.fsck.k9.helper.ReplyToParser +import com.fsck.k9.mail.buildMessage +import com.google.common.truth.Truth.assertThat +import org.junit.Test + +private const val IDENTITY_EMAIL_ADDRESS = "myself@domain.example" + +class ReplyActionStrategyTest { + private val account = createAccount() + private val replyActionStrategy = ReplyActionStrategy(ReplyToParser()) + + @Test + fun `message sent to only our identity`() { + val message = buildMessage { + header("From", "sender@domain.example") + header("To", IDENTITY_EMAIL_ADDRESS) + } + + val replyActions = replyActionStrategy.getReplyActions(account, message) + + assertThat(replyActions.defaultAction).isEqualTo(ReplyAction.REPLY) + assertThat(replyActions.additionalActions).isEmpty() + } + + @Test + fun `message sent to our identity and others`() { + val message = buildMessage { + header("From", "sender@domain.example") + header("To", "$IDENTITY_EMAIL_ADDRESS, other@domain.example") + } + + val replyActions = replyActionStrategy.getReplyActions(account, message) + + assertThat(replyActions.defaultAction).isEqualTo(ReplyAction.REPLY_ALL) + assertThat(replyActions.additionalActions).containsExactly(ReplyAction.REPLY) + } + + @Test + fun `message sent to our identity and others (CC)`() { + val message = buildMessage { + header("From", "sender@domain.example") + header("Cc", "$IDENTITY_EMAIL_ADDRESS, other@domain.example") + } + + val replyActions = replyActionStrategy.getReplyActions(account, message) + + assertThat(replyActions.defaultAction).isEqualTo(ReplyAction.REPLY_ALL) + assertThat(replyActions.additionalActions).containsExactly(ReplyAction.REPLY) + } + + @Test + fun `message sent to our identity and others (To+CC)`() { + val message = buildMessage { + header("From", "sender@domain.example") + header("To", IDENTITY_EMAIL_ADDRESS) + header("Cc", "other@domain.example") + } + + val replyActions = replyActionStrategy.getReplyActions(account, message) + + assertThat(replyActions.defaultAction).isEqualTo(ReplyAction.REPLY_ALL) + assertThat(replyActions.additionalActions).containsExactly(ReplyAction.REPLY) + } + + @Test + fun `message sent to our identity and others (CC+To)`() { + val message = buildMessage { + header("From", "sender@domain.example") + header("To", "other@domain.example") + header("Cc", IDENTITY_EMAIL_ADDRESS) + } + + val replyActions = replyActionStrategy.getReplyActions(account, message) + + assertThat(replyActions.defaultAction).isEqualTo(ReplyAction.REPLY_ALL) + assertThat(replyActions.additionalActions).containsExactly(ReplyAction.REPLY) + } + + @Test + fun `message where neither sender nor recipient addresses belong to account`() { + val message = buildMessage { + header("From", "sender@domain.example") + header("To", "recipient@domain.example") + } + + val replyActions = replyActionStrategy.getReplyActions(account, message) + + assertThat(replyActions.defaultAction).isEqualTo(ReplyAction.REPLY_ALL) + assertThat(replyActions.additionalActions).containsExactly(ReplyAction.REPLY) + } + + @Test + fun `message without any sender or recipient headers`() { + val message = buildMessage {} + + val replyActions = replyActionStrategy.getReplyActions(account, message) + + assertThat(replyActions.defaultAction).isNull() + assertThat(replyActions.additionalActions).isEmpty() + } + + private fun createAccount(): Account { + return Account("00000000-0000-4000-0000-000000000000").apply { + identities += Identity(name = "Myself", email = IDENTITY_EMAIL_ADDRESS) + } + } +} -- GitLab From 53aeb4224a5f53963d185ce82e22a83dc303a3dd Mon Sep 17 00:00:00 2001 From: cketti Date: Mon, 21 Nov 2022 16:54:11 +0100 Subject: [PATCH 13/41] Add functionality for primary reply action in message view --- .../MessageHeaderOnMenuItemClickListener.kt | 5 + .../k9/ui/messageview/MessageTopView.java | 4 +- .../k9/ui/messageview/MessageViewFragment.kt | 8 +- .../main/java/com/fsck/k9/view/KoinModule.kt | 4 + .../java/com/fsck/k9/view/MessageHeader.java | 100 ++++++++++++++++-- .../legacy/src/main/res/drawable/ic_reply.xml | 10 ++ 6 files changed, 114 insertions(+), 17 deletions(-) create mode 100644 app/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageHeaderOnMenuItemClickListener.kt create mode 100644 app/ui/legacy/src/main/res/drawable/ic_reply.xml diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageHeaderOnMenuItemClickListener.kt b/app/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageHeaderOnMenuItemClickListener.kt new file mode 100644 index 0000000000..fc1126d01b --- /dev/null +++ b/app/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageHeaderOnMenuItemClickListener.kt @@ -0,0 +1,5 @@ +package com.fsck.k9.ui.messageview + +fun interface MessageHeaderOnMenuItemClickListener { + fun onMenuItemClick(itemId: Int) +} diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageTopView.java b/app/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageTopView.java index da82cc2dcf..0329d528e5 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageTopView.java +++ b/app/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageTopView.java @@ -9,7 +9,7 @@ import android.graphics.drawable.Drawable; import android.os.Parcel; import android.os.Parcelable; import androidx.annotation.NonNull; -import androidx.appcompat.widget.PopupMenu.OnMenuItemClickListener; + import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; @@ -226,7 +226,7 @@ public class MessageTopView extends LinearLayout { mHeaderContainer.setOnFlagListener(listener); } - public void setOnMenuItemClickListener(OnMenuItemClickListener listener) { + public void setOnMenuItemClickListener(MessageHeaderOnMenuItemClickListener listener) { mHeaderContainer.setOnMenuItemClickListener(listener); } diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageViewFragment.kt b/app/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageViewFragment.kt index f7b7d01244..513b97cbf5 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageViewFragment.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageViewFragment.kt @@ -158,9 +158,7 @@ class MessageViewFragment : onToggleFlagged() } - messageTopView.setOnMenuItemClickListener { item -> - onReplyMenuItemClicked(item.itemId) - } + messageTopView.setOnMenuItemClickListener(::onReplyMenuItemClicked) messageTopView.setOnDownloadButtonClickListener { onDownloadButtonClicked() @@ -381,7 +379,7 @@ class MessageViewFragment : messageTopView.setSubject(displaySubject) } - private fun onReplyMenuItemClicked(itemId: Int): Boolean { + private fun onReplyMenuItemClicked(itemId: Int) { when (itemId) { R.id.reply -> onReply() R.id.reply_all -> onReplyAll() @@ -390,8 +388,6 @@ class MessageViewFragment : R.id.share -> onSendAlternate() else -> error("Missing handler for reply menu item $itemId") } - - return true } private fun onDownloadButtonClicked() { diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/view/KoinModule.kt b/app/ui/legacy/src/main/java/com/fsck/k9/view/KoinModule.kt index d86dd2b718..269d220fd9 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/view/KoinModule.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/view/KoinModule.kt @@ -1,9 +1,13 @@ package com.fsck.k9.view +import com.fsck.k9.helper.ReplyToParser +import com.fsck.k9.message.ReplyActionStrategy import com.fsck.k9.ui.helper.RelativeDateTimeFormatter import org.koin.dsl.module val viewModule = module { single { WebViewConfigProvider(themeManager = get()) } factory { RelativeDateTimeFormatter(context = get(), clock = get()) } + factory { ReplyToParser() } + factory { ReplyActionStrategy(replyRoParser = get()) } } diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java b/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java index 94afcd61d5..433051a022 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java +++ b/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java @@ -1,6 +1,8 @@ package com.fsck.k9.view; +import java.util.List; + import android.content.Context; import android.content.res.ColorStateList; import android.util.AttributeSet; @@ -12,9 +14,9 @@ import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; +import androidx.annotation.DrawableRes; import androidx.annotation.NonNull; import androidx.appcompat.widget.PopupMenu; -import androidx.appcompat.widget.PopupMenu.OnMenuItemClickListener; import com.fsck.k9.Account; import com.fsck.k9.DI; import com.fsck.k9.FontSizes; @@ -26,8 +28,12 @@ import com.fsck.k9.helper.MessageHelper; import com.fsck.k9.mail.Address; import com.fsck.k9.mail.Flag; import com.fsck.k9.mail.Message; +import com.fsck.k9.message.ReplyAction; +import com.fsck.k9.message.ReplyActionStrategy; +import com.fsck.k9.message.ReplyActions; import com.fsck.k9.ui.R; import com.fsck.k9.ui.helper.RelativeDateTimeFormatter; +import com.fsck.k9.ui.messageview.MessageHeaderOnMenuItemClickListener; import com.google.android.material.chip.Chip; import com.google.android.material.snackbar.Snackbar; @@ -35,6 +41,7 @@ import com.google.android.material.snackbar.Snackbar; public class MessageHeader extends LinearLayout implements OnClickListener, OnLongClickListener { private static final int DEFAULT_SUBJECT_LINES = 3; + private final ReplyActionStrategy replyActionStrategy = DI.get(ReplyActionStrategy.class); private final FontSizes fontSizes = K9.getFontSizes(); private Chip accountChip; @@ -46,11 +53,13 @@ public class MessageHeader extends LinearLayout implements OnClickListener, OnLo private TextView toView; private TextView toCountView; private TextView dateView; + private ImageView menuPrimaryActionView; private MessageHelper messageHelper; private RelativeDateTimeFormatter relativeDateTimeFormatter; - private OnMenuItemClickListener onMenuItemClickListener; + private MessageHeaderOnMenuItemClickListener onMenuItemClickListener; + private ReplyActions replyActions; public MessageHeader(Context context, AttributeSet attrs) { @@ -85,7 +94,7 @@ public class MessageHeader extends LinearLayout implements OnClickListener, OnLo subjectView.setOnClickListener(this); subjectView.setOnLongClickListener(this); - View menuPrimaryActionView = findViewById(R.id.menu_primary_action); + menuPrimaryActionView = findViewById(R.id.menu_primary_action); menuPrimaryActionView.setOnClickListener(this); menuPrimaryActionView.setOnLongClickListener(this); @@ -102,17 +111,46 @@ public class MessageHeader extends LinearLayout implements OnClickListener, OnLo if (id == R.id.subject) { toggleSubjectViewMaxLines(); } else if (id == R.id.menu_primary_action) { - Snackbar.make(getRootView(), "TODO: Perform primary action", Snackbar.LENGTH_LONG).show(); + performPrimaryReplyAction(); } else if (id == R.id.menu_overflow) { - PopupMenu popupMenu = new PopupMenu(getContext(), view); - popupMenu.setOnMenuItemClickListener(onMenuItemClickListener); - popupMenu.inflate(R.menu.single_message_options); - popupMenu.show(); + showOverflowMenu(view); } else if (id == R.id.participants_container) { Snackbar.make(getRootView(), "TODO: Display details popup", Snackbar.LENGTH_LONG).show(); } } + private void performPrimaryReplyAction() { + ReplyAction defaultAction = replyActions.getDefaultAction(); + if (defaultAction == null) { + return; + } + + switch (defaultAction) { + case REPLY: { + onMenuItemClickListener.onMenuItemClick(R.id.reply); + break; + } + case REPLY_ALL: { + onMenuItemClickListener.onMenuItemClick(R.id.reply_all); + break; + } + default: { + throw new IllegalStateException("Unknown reply action: " + defaultAction); + } + } + } + + private void showOverflowMenu(View view) { + PopupMenu popupMenu = new PopupMenu(getContext(), view); + popupMenu.setOnMenuItemClickListener(item -> { + onMenuItemClickListener.onMenuItemClick(item.getItemId()); + return true; + }); + popupMenu.inflate(R.menu.single_message_options); + setAdditionalReplyActions(popupMenu); + popupMenu.show(); + } + @Override public boolean onLongClick(View view) { int id = view.getId(); @@ -190,9 +228,53 @@ public class MessageHeader extends LinearLayout implements OnClickListener, OnLo dateView.setText(""); } + setReplyActions(message, account); + setVisibility(View.VISIBLE); } + private void setReplyActions(Message message, Account account) { + ReplyActions replyActions = replyActionStrategy.getReplyActions(account, message); + this.replyActions = replyActions; + + setDefaultReplyAction(replyActions.getDefaultAction()); + } + + private void setDefaultReplyAction(ReplyAction defaultAction) { + if (defaultAction == null) { + menuPrimaryActionView.setVisibility(View.GONE); + } else { + int replyIconResource = getReplyImageResource(defaultAction); + menuPrimaryActionView.setImageResource(replyIconResource); + menuPrimaryActionView.setVisibility(View.VISIBLE); + } + } + + @DrawableRes + private int getReplyImageResource(@NonNull ReplyAction replyAction) { + switch (replyAction) { + case REPLY: { + return R.drawable.ic_reply; + } + case REPLY_ALL: { + return R.drawable.ic_reply_all; + } + default: { + throw new IllegalStateException("Unknown reply action: " + replyAction); + } + } + } + + private void setAdditionalReplyActions(PopupMenu popupMenu) { + List additionalActions = replyActions.getAdditionalActions(); + if (!additionalActions.contains(ReplyAction.REPLY)) { + popupMenu.getMenu().removeItem(R.id.reply); + } + if (!additionalActions.contains(ReplyAction.REPLY_ALL)) { + popupMenu.getMenu().removeItem(R.id.reply_all); + } + } + public void setSubject(@NonNull String subject) { subjectView.setText(subject); } @@ -221,7 +303,7 @@ public class MessageHeader extends LinearLayout implements OnClickListener, OnLo cryptoStatusIcon.setColorFilter(color); } - public void setOnMenuItemClickListener(OnMenuItemClickListener onMenuItemClickListener) { + public void setOnMenuItemClickListener(MessageHeaderOnMenuItemClickListener onMenuItemClickListener) { this.onMenuItemClickListener = onMenuItemClickListener; } } diff --git a/app/ui/legacy/src/main/res/drawable/ic_reply.xml b/app/ui/legacy/src/main/res/drawable/ic_reply.xml new file mode 100644 index 0000000000..bd35ee9e7e --- /dev/null +++ b/app/ui/legacy/src/main/res/drawable/ic_reply.xml @@ -0,0 +1,10 @@ + + + -- GitLab From 85762d5ec7a27c9658be2d1202d98b6510a12e8a Mon Sep 17 00:00:00 2001 From: cketti Date: Tue, 22 Nov 2022 17:30:46 +0100 Subject: [PATCH 14/41] Display tooltips when long-pressing the menu actions --- .../java/com/fsck/k9/view/MessageHeader.java | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java b/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java index 433051a022..71e0651f54 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java +++ b/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageHeader.java @@ -17,6 +17,7 @@ import android.widget.Toast; import androidx.annotation.DrawableRes; import androidx.annotation.NonNull; import androidx.appcompat.widget.PopupMenu; +import androidx.appcompat.widget.TooltipCompat; import com.fsck.k9.Account; import com.fsck.k9.DI; import com.fsck.k9.FontSizes; @@ -96,11 +97,12 @@ public class MessageHeader extends LinearLayout implements OnClickListener, OnLo menuPrimaryActionView = findViewById(R.id.menu_primary_action); menuPrimaryActionView.setOnClickListener(this); - menuPrimaryActionView.setOnLongClickListener(this); View menuOverflowView = findViewById(R.id.menu_overflow); menuOverflowView.setOnClickListener(this); - menuOverflowView.setOnLongClickListener(this); + String menuOverflowDescription = + getContext().getString(androidx.appcompat.R.string.abc_action_menu_overflow_description); + TooltipCompat.setTooltipText(menuOverflowView, menuOverflowDescription); findViewById(R.id.participants_container).setOnClickListener(this); } @@ -246,6 +248,10 @@ public class MessageHeader extends LinearLayout implements OnClickListener, OnLo } else { int replyIconResource = getReplyImageResource(defaultAction); menuPrimaryActionView.setImageResource(replyIconResource); + + String replyActionName = getReplyActionName(defaultAction); + TooltipCompat.setTooltipText(menuPrimaryActionView, replyActionName); + menuPrimaryActionView.setVisibility(View.VISIBLE); } } @@ -265,6 +271,22 @@ public class MessageHeader extends LinearLayout implements OnClickListener, OnLo } } + @NonNull + private String getReplyActionName(@NonNull ReplyAction replyAction) { + Context context = getContext(); + switch (replyAction) { + case REPLY: { + return context.getString(R.string.reply_action); + } + case REPLY_ALL: { + return context.getString(R.string.reply_all_action); + } + default: { + throw new IllegalStateException("Unknown reply action: " + replyAction); + } + } + } + private void setAdditionalReplyActions(PopupMenu popupMenu) { List additionalActions = replyActions.getAdditionalActions(); if (!additionalActions.contains(ReplyAction.REPLY)) { -- GitLab From 5a43ff6607db3d6efedb84fe803ebd996e198d0c Mon Sep 17 00:00:00 2001 From: cketti Date: Wed, 23 Nov 2022 19:40:21 +0100 Subject: [PATCH 15/41] Fix message header background color --- app/ui/legacy/src/main/res/layout/message_view_header.xml | 2 +- app/ui/legacy/src/main/res/values/attrs.xml | 1 + app/ui/legacy/src/main/res/values/themes.xml | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/ui/legacy/src/main/res/layout/message_view_header.xml b/app/ui/legacy/src/main/res/layout/message_view_header.xml index f70740b097..d64c21e78a 100644 --- a/app/ui/legacy/src/main/res/layout/message_view_header.xml +++ b/app/ui/legacy/src/main/res/layout/message_view_header.xml @@ -75,7 +75,7 @@ android:id="@+id/participants_container" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="?attr/colorPrimary" + android:background="?attr/messageHeaderBackground" android:clickable="true" android:focusable="true" android:foreground="?attr/selectableItemBackground" diff --git a/app/ui/legacy/src/main/res/values/attrs.xml b/app/ui/legacy/src/main/res/values/attrs.xml index 4c8f7d1c3d..9f9dabc621 100644 --- a/app/ui/legacy/src/main/res/values/attrs.xml +++ b/app/ui/legacy/src/main/res/values/attrs.xml @@ -3,6 +3,7 @@ + diff --git a/app/ui/legacy/src/main/res/values/themes.xml b/app/ui/legacy/src/main/res/values/themes.xml index 9fd4161970..2a5c4c0077 100644 --- a/app/ui/legacy/src/main/res/values/themes.xml +++ b/app/ui/legacy/src/main/res/values/themes.xml @@ -20,6 +20,7 @@ @color/material_blue_800 @color/material_pink_400 @color/material_pink_200 + @color/material_gray_100 @color/material_gray_50 @style/Widget.K9.Toolbar @@ -173,6 +174,7 @@ @color/material_blue_600 @color/material_pink_300 @color/material_pink_500 + @color/material_gray_900 @color/material_gray_900 @style/Widget.K9.Toolbar -- GitLab From 1a34e49e912fc02b4fd2d96b168eb18d93e406a8 Mon Sep 17 00:00:00 2001 From: cketti Date: Wed, 23 Nov 2022 20:30:49 +0100 Subject: [PATCH 16/41] Change appearance of "show remote images" button --- .../k9/ui/messageview/MessageTopView.java | 6 ++-- app/ui/legacy/src/main/res/layout/message.xml | 32 +++++++++++-------- .../legacy/src/main/res/values-ar/strings.xml | 1 - .../legacy/src/main/res/values-be/strings.xml | 1 - .../legacy/src/main/res/values-bg/strings.xml | 1 - .../legacy/src/main/res/values-br/strings.xml | 1 - .../legacy/src/main/res/values-ca/strings.xml | 1 - .../legacy/src/main/res/values-cs/strings.xml | 1 - .../legacy/src/main/res/values-cy/strings.xml | 1 - .../legacy/src/main/res/values-da/strings.xml | 1 - .../legacy/src/main/res/values-de/strings.xml | 1 - .../legacy/src/main/res/values-el/strings.xml | 1 - .../legacy/src/main/res/values-eo/strings.xml | 1 - .../legacy/src/main/res/values-es/strings.xml | 1 - .../legacy/src/main/res/values-et/strings.xml | 1 - .../legacy/src/main/res/values-eu/strings.xml | 1 - .../legacy/src/main/res/values-fa/strings.xml | 1 - .../legacy/src/main/res/values-fi/strings.xml | 1 - .../legacy/src/main/res/values-fr/strings.xml | 1 - .../legacy/src/main/res/values-fy/strings.xml | 1 - .../legacy/src/main/res/values-gd/strings.xml | 1 - .../src/main/res/values-gl-rES/strings.xml | 1 - .../legacy/src/main/res/values-gl/strings.xml | 1 - .../legacy/src/main/res/values-hr/strings.xml | 1 - .../legacy/src/main/res/values-hu/strings.xml | 1 - .../legacy/src/main/res/values-in/strings.xml | 1 - .../legacy/src/main/res/values-is/strings.xml | 1 - .../legacy/src/main/res/values-it/strings.xml | 1 - .../legacy/src/main/res/values-iw/strings.xml | 1 - .../legacy/src/main/res/values-ja/strings.xml | 1 - .../legacy/src/main/res/values-ko/strings.xml | 1 - .../legacy/src/main/res/values-lt/strings.xml | 1 - .../legacy/src/main/res/values-lv/strings.xml | 1 - .../legacy/src/main/res/values-ml/strings.xml | 1 - .../legacy/src/main/res/values-nb/strings.xml | 1 - .../legacy/src/main/res/values-nl/strings.xml | 1 - .../legacy/src/main/res/values-pl/strings.xml | 1 - .../src/main/res/values-pt-rBR/strings.xml | 1 - .../src/main/res/values-pt-rPT/strings.xml | 1 - .../legacy/src/main/res/values-ro/strings.xml | 1 - .../legacy/src/main/res/values-ru/strings.xml | 1 - .../legacy/src/main/res/values-sk/strings.xml | 1 - .../legacy/src/main/res/values-sl/strings.xml | 1 - .../legacy/src/main/res/values-sq/strings.xml | 1 - .../legacy/src/main/res/values-sr/strings.xml | 1 - .../legacy/src/main/res/values-sv/strings.xml | 1 - .../legacy/src/main/res/values-tr/strings.xml | 1 - .../legacy/src/main/res/values-uk/strings.xml | 1 - .../src/main/res/values-zh-rCN/strings.xml | 1 - .../src/main/res/values-zh-rTW/strings.xml | 1 - app/ui/legacy/src/main/res/values/attrs.xml | 1 + app/ui/legacy/src/main/res/values/strings.xml | 5 ++- app/ui/legacy/src/main/res/values/themes.xml | 4 ++- 53 files changed, 31 insertions(+), 65 deletions(-) diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageTopView.java b/app/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageTopView.java index 0329d528e5..3a65697b45 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageTopView.java +++ b/app/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageTopView.java @@ -51,6 +51,7 @@ public class MessageTopView extends LinearLayout { private ViewGroup containerView; private Button mDownloadRemainder; private AttachmentViewCallback attachmentCallback; + private View extraHeaderContainer; private Button showPicturesButton; private boolean isShowingProgress; private boolean showPicturesButtonClicked; @@ -78,6 +79,7 @@ public class MessageTopView extends LinearLayout { mDownloadRemainder = findViewById(R.id.download_remainder); mDownloadRemainder.setVisibility(View.GONE); + extraHeaderContainer = findViewById(R.id.extra_header_container); showPicturesButton = findViewById(R.id.show_pictures); setShowPicturesButtonListener(); @@ -264,11 +266,11 @@ public class MessageTopView extends LinearLayout { } private void showShowPicturesButton() { - showPicturesButton.setVisibility(View.VISIBLE); + extraHeaderContainer.setVisibility(View.VISIBLE); } private void hideShowPicturesButton() { - showPicturesButton.setVisibility(View.GONE); + extraHeaderContainer.setVisibility(View.GONE); } private boolean shouldAutomaticallyLoadPictures(ShowPictures showPicturesSetting, Message message) { diff --git a/app/ui/legacy/src/main/res/layout/message.xml b/app/ui/legacy/src/main/res/layout/message.xml index ef38a18c1e..1ac80286db 100644 --- a/app/ui/legacy/src/main/res/layout/message.xml +++ b/app/ui/legacy/src/main/res/layout/message.xml @@ -2,7 +2,7 @@ -