Message List: Add en dash to separate sender name and preview text

This commit is contained in:
cketti 2023-02-21 13:47:09 +01:00
parent 0a8ed1569e
commit b3354b4179
2 changed files with 4 additions and 2 deletions

View file

@ -343,7 +343,9 @@ class MessageListAdapter internal constructor(
val messageStringBuilder = SpannableStringBuilder(beforePreviewText) val messageStringBuilder = SpannableStringBuilder(beforePreviewText)
if (appearance.previewLines > 0) { if (appearance.previewLines > 0) {
val preview = getPreview(isMessageEncrypted, previewText) val preview = getPreview(isMessageEncrypted, previewText)
messageStringBuilder.append(" ").append(preview) if (preview.isNotEmpty()) {
messageStringBuilder.append(" ").append(preview)
}
} }
holder.preview.setText(messageStringBuilder, TextView.BufferType.SPANNABLE) holder.preview.setText(messageStringBuilder, TextView.BufferType.SPANNABLE)

View file

@ -472,7 +472,7 @@ class MessageListAdapterTest : RobolectricTest() {
return holder.itemView return holder.itemView
} }
fun secondLine(senderOrSubject: String, preview: String) = "$senderOrSubject $preview" fun secondLine(senderOrSubject: String, preview: String) = "$senderOrSubject $preview"
val View.accountChipView: View get() = findViewById(R.id.account_color_chip) val View.accountChipView: View get() = findViewById(R.id.account_color_chip)
val View.starView: View get() = findViewById(R.id.star) val View.starView: View get() = findViewById(R.id.star)