diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index 12ba39a71d..7c8e707ca8 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -143,6 +143,7 @@ public class AdapterMessage extends PagedListAdapter 0 ? View.VISIBLE : View.GONE); tvFrom.setText(MessageHelper.getFormattedAddresses(outgoing ? message.to : message.from, !compact)); + tvSize.setText(message.size == null ? null : Helper.humanReadableByteCount(message.size, true)); + tvSize.setVisibility(message.size == null || message.content ? View.GONE : View.VISIBLE); tvTime.setText(DateUtils.getRelativeTimeSpanString(context, message.received)); ivAnswered.setVisibility(message.ui_answered ? View.VISIBLE : View.GONE); @@ -415,6 +420,7 @@ public class AdapterMessage extends PagedListAdapter 0 ? Typeface.BOLD : Typeface.NORMAL); tvFrom.setTypeface(null, typeface); + tvSize.setTypeface(null, typeface); tvTime.setTypeface(null, typeface); tvSubject.setTypeface(null, typeface); tvCount.setTypeface(null, typeface); @@ -422,6 +428,7 @@ public class AdapterMessage extends PagedListAdapter 0 ? R.attr.colorUnread : android.R.attr.textColorSecondary); tvFrom.setTextColor(colorUnseen); + tvSize.setTextColor(colorUnseen); tvTime.setTextColor(colorUnseen); grpAddress.setVisibility(viewType == ViewType.THREAD && show_expanded && show_addresses ? View.VISIBLE : View.GONE); @@ -453,10 +460,10 @@ public class AdapterMessage extends PagedListAdapter + + + app:layout_constraintTop_toBottomOf="@id/tvSizeEx" /> + app:constraint_referenced_ids="tvFromExTitle,tvFromEx,tvToTitle,tvTo,tvReplyToTitle,tvReplyTo,tvCcTitle,tvCc,tvBccTitle,tvBcc,tvTimeExTitle,tvTimeEx,tvSizeExTitle,tvSizeEx,tvSubjectEx" /> - \ No newline at end of file + diff --git a/app/src/main/res/layout/item_message_normal.xml b/app/src/main/res/layout/item_message_normal.xml index 5abef9aa4c..c3e5fbd75d 100644 --- a/app/src/main/res/layout/item_message_normal.xml +++ b/app/src/main/res/layout/item_message_normal.xml @@ -77,10 +77,22 @@ android:ellipsize="end" android:text="From" android:textAppearance="@style/TextAppearance.AppCompat.Medium" - app:layout_constraintEnd_toStartOf="@+id/tvTime" + app:layout_constraintEnd_toStartOf="@+id/tvSize" app:layout_constraintStart_toEndOf="@id/ivAvatar" app:layout_constraintTop_toBottomOf="@id/paddingTop" /> + + + app:layout_constraintTop_toBottomOf="@id/tvSizeEx" /> + app:constraint_referenced_ids="tvFromExTitle,tvFromEx,tvToTitle,tvTo,tvReplyToTitle,tvReplyTo,tvCcTitle,tvCc,tvBccTitle,tvBcc,tvTimeExTitle,tvTimeEx,tvSizeExTitle,tvSizeEx,tvSubjectEx" /> - \ No newline at end of file +