From 5e453492ab9c741ae7dd927f8431fd818c18f481 Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 30 Mar 2020 18:12:36 +0200 Subject: [PATCH] Show CC/BCC in identity selector --- .../faircode/email/AdapterIdentitySelect.java | 5 ++- app/src/main/res/layout/spinner_identity.xml | 15 ++++++- .../res/layout/spinner_identity_dropdown.xml | 42 ------------------- 3 files changed, 18 insertions(+), 44 deletions(-) delete mode 100644 app/src/main/res/layout/spinner_identity_dropdown.xml diff --git a/app/src/main/java/eu/faircode/email/AdapterIdentitySelect.java b/app/src/main/java/eu/faircode/email/AdapterIdentitySelect.java index 72f18f5aea..3970374dc5 100644 --- a/app/src/main/java/eu/faircode/email/AdapterIdentitySelect.java +++ b/app/src/main/java/eu/faircode/email/AdapterIdentitySelect.java @@ -31,7 +31,7 @@ public class AdapterIdentitySelect extends ArrayAdapter { @Override public View getDropDownView(int position, View convertView, @NonNull ViewGroup parent) { - return getLayout(position, convertView, parent, R.layout.spinner_identity_dropdown); + return getLayout(position, convertView, parent, R.layout.spinner_identity); } private View getLayout(int position, View convertView, ViewGroup parent, int resid) { @@ -42,10 +42,13 @@ public class AdapterIdentitySelect extends ArrayAdapter { View vwColor = view.findViewById(R.id.vwColor); TextView text1 = view.findViewById(android.R.id.text1); TextView text2 = view.findViewById(android.R.id.text2); + TextView tvExtra = view.findViewById(R.id.tvExtra); vwColor.setBackgroundColor(identity.color == null ? Color.TRANSPARENT : identity.color); text1.setText(identity.getDisplayName() + (identity.primary ? " ★" : "")); text2.setText(identity.accountName + "/" + identity.email); + tvExtra.setText((identity.cc == null ? "" : "+CC") + (identity.bcc == null ? "" : "+BCC")); + tvExtra.setVisibility(identity.cc == null && identity.bcc == null ? View.GONE : View.VISIBLE); return view; } diff --git a/app/src/main/res/layout/spinner_identity.xml b/app/src/main/res/layout/spinner_identity.xml index 4c27c15f34..a431360a8e 100644 --- a/app/src/main/res/layout/spinner_identity.xml +++ b/app/src/main/res/layout/spinner_identity.xml @@ -36,7 +36,20 @@ android:text="Text2" android:textAppearance="@style/TextAppearance.AppCompat.Small" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintEnd_toStartOf="@+id/tvExtra" app:layout_constraintStart_toEndOf="@id/vwColor" app:layout_constraintTop_toBottomOf="@android:id/text1" /> + + \ No newline at end of file diff --git a/app/src/main/res/layout/spinner_identity_dropdown.xml b/app/src/main/res/layout/spinner_identity_dropdown.xml deleted file mode 100644 index 4c27c15f34..0000000000 --- a/app/src/main/res/layout/spinner_identity_dropdown.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - \ No newline at end of file