diff --git a/app/ui/message-list-widget/src/main/java/app/k9mail/ui/widget/list/MessageListItem.kt b/app/ui/message-list-widget/src/main/java/app/k9mail/ui/widget/list/MessageListItem.kt index ecedb6334..9ebfab398 100644 --- a/app/ui/message-list-widget/src/main/java/app/k9mail/ui/widget/list/MessageListItem.kt +++ b/app/ui/message-list-widget/src/main/java/app/k9mail/ui/widget/list/MessageListItem.kt @@ -9,6 +9,7 @@ internal data class MessageListItem( val preview: String, val isRead: Boolean, val hasAttachments: Boolean, + val threadCount: Int, val uri: Uri, val accountColor: Int, val uniqueId: Long, diff --git a/app/ui/message-list-widget/src/main/java/app/k9mail/ui/widget/list/MessageListItemMapper.kt b/app/ui/message-list-widget/src/main/java/app/k9mail/ui/widget/list/MessageListItemMapper.kt index 35efd356e..5d18bbc58 100644 --- a/app/ui/message-list-widget/src/main/java/app/k9mail/ui/widget/list/MessageListItemMapper.kt +++ b/app/ui/message-list-widget/src/main/java/app/k9mail/ui/widget/list/MessageListItemMapper.kt @@ -37,6 +37,7 @@ internal class MessageListItemMapper( preview = previewText, isRead = message.isRead, hasAttachments = message.hasAttachments, + threadCount = message.threadCount, uri = uri, accountColor = account.chipColor, uniqueId = uniqueId, diff --git a/app/ui/message-list-widget/src/main/java/app/k9mail/ui/widget/list/MessageListRemoteViewFactory.kt b/app/ui/message-list-widget/src/main/java/app/k9mail/ui/widget/list/MessageListRemoteViewFactory.kt index 0e5566d92..ef14511b6 100644 --- a/app/ui/message-list-widget/src/main/java/app/k9mail/ui/widget/list/MessageListRemoteViewFactory.kt +++ b/app/ui/message-list-widget/src/main/java/app/k9mail/ui/widget/list/MessageListRemoteViewFactory.kt @@ -75,6 +75,13 @@ internal class MessageListRemoteViewFactory(private val context: Context) : Remo remoteView.setTextViewText(R.id.mail_date, item.displayDate) remoteView.setTextViewText(R.id.mail_preview, item.preview) + if (item.threadCount > 1) { + remoteView.setTextViewText(R.id.thread_count, item.threadCount.toString()) + remoteView.setInt(R.id.thread_count, "setVisibility", View.VISIBLE) + } else { + remoteView.setInt(R.id.thread_count, "setVisibility", View.GONE) + } + val textColor = getTextColor(item) remoteView.setTextColor(R.id.sender, textColor) remoteView.setTextColor(R.id.mail_subject, textColor) diff --git a/app/ui/message-list-widget/src/main/res/layout/message_list_widget_list_item.xml b/app/ui/message-list-widget/src/main/res/layout/message_list_widget_list_item.xml index 368ee21e9..661b36200 100644 --- a/app/ui/message-list-widget/src/main/res/layout/message_list_widget_list_item.xml +++ b/app/ui/message-list-widget/src/main/res/layout/message_list_widget_list_item.xml @@ -39,6 +39,21 @@ android:visibility="gone" tools:visibility="visible" /> + +