diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index 267f7a0d2a..462548a8e2 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -200,10 +200,21 @@ public class AdapterMessage extends RecyclerView.Adapter 0); - boolean channel = (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O); - grpAddress.setVisibility(show_addresses ? View.VISIBLE : View.GONE); + boolean hasFrom = (message.from != null && message.from.length > 0); + boolean hasChannel = (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O); + ivSearchContact.setVisibility(show_addresses && search && BuildConfig.DEBUG ? View.VISIBLE : View.GONE); - ivNotifyContact.setVisibility(show_addresses && channel && from ? View.VISIBLE : View.GONE); - ivAddContact.setVisibility(show_addresses && contacts && from ? View.VISIBLE : View.GONE); + ivNotifyContact.setVisibility(show_addresses && hasChannel && hasFrom ? View.VISIBLE : View.GONE); + ivAddContact.setVisibility(show_addresses && contacts && hasFrom ? View.VISIBLE : View.GONE); grpHeaders.setVisibility(show_headers ? View.VISIBLE : View.GONE); if (show_headers && message.headers == null) { @@ -783,35 +798,65 @@ public class AdapterMessage extends RecyclerView.Adapter 0 ? View.VISIBLE : View.GONE); tvKeywords.setText(TextUtils.join(" ", message.keywords)); - tvKeywords.setVisibility(message.keywords.length > 0 ? View.VISIBLE : View.GONE); // Headers if (show_headers && message.headers != null) { diff --git a/app/src/main/res/layout/include_addresses.xml b/app/src/main/res/layout/include_addresses.xml new file mode 100644 index 0000000000..364637051e --- /dev/null +++ b/app/src/main/res/layout/include_addresses.xml @@ -0,0 +1,248 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_message_compact.xml b/app/src/main/res/layout/item_message_compact.xml index c648a10a7e..a23f45d00b 100644 --- a/app/src/main/res/layout/item_message_compact.xml +++ b/app/src/main/res/layout/item_message_compact.xml @@ -338,259 +338,16 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/vSeparatorAddress" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + app:layout_constraintTop_toBottomOf="@id/inAddresses" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + app:layout_constraintTop_toBottomOf="@id/inAddresses" /> - -