From 4148b28f615a1af5c8ba59c3a4e881acd80a11c9 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 28 Feb 2020 19:01:53 +0100 Subject: [PATCH] Show number of additional recipients --- app/src/main/java/eu/faircode/email/AdapterMessage.java | 9 ++++++++- app/src/main/java/eu/faircode/email/FragmentCompose.java | 6 +++++- app/src/main/res/values/strings.xml | 1 + 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index f5ab51c918..af54aa979a 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -784,6 +784,9 @@ public class AdapterMessage extends RecyclerView.Adapter 0 ? View.VISIBLE : View.GONE); ivEncrypted.setVisibility(message.encrypted > 0 ? View.VISIBLE : View.GONE); - tvFrom.setText(MessageHelper.formatAddresses(addresses, name_email, false)); + if (recipients == 0 || viewType != ViewType.THREAD) + tvFrom.setText(MessageHelper.formatAddresses(addresses, name_email, false)); + else + tvFrom.setText(context.getString(R.string.title_name_plus, + MessageHelper.formatAddresses(addresses, name_email, false), recipients)); tvFrom.setPaintFlags(tvFrom.getPaintFlags() & ~Paint.UNDERLINE_TEXT_FLAG); tvSize.setText(message.totalSize == null ? null : Helper.humanReadableByteCount(message.totalSize, true)); tvSize.setVisibility( diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index c3645e2378..398f60db2e 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -4608,7 +4608,11 @@ public class FragmentCompose extends FragmentBase { int to = (draft.to == null ? 0 : draft.to.length); int cc = (draft.cc == null ? 0 : draft.cc.length) + (draft.bcc == null ? 0 : draft.bcc.length); - tvTo.setText(MessageHelper.formatAddressesShort(draft.to) + (cc > 0 ? " +" + cc : "")); + if (cc == 0) + tvTo.setText(MessageHelper.formatAddressesShort(draft.to)); + else + tvTo.setText(getString(R.string.title_name_plus, + MessageHelper.formatAddressesShort(draft.to), cc)); tvTo.setTextColor(Helper.resolveColor(getContext(), to + cc > RECIPIENTS_WARNING ? R.attr.colorWarning : android.R.attr.textColorPrimary)); tvVia.setText(draft.identityEmail); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 3fa0b41380..ac9e34731a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -99,6 +99,7 @@ \'%1$s\' server alert %1$s (%2$s) + %1$s +%2$d %1$d minutes Exit