Loading app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListAdapter.kt +20 −10 Original line number Diff line number Diff line Loading @@ -47,10 +47,13 @@ class MessageListAdapter internal constructor( private val forwardedIcon: Drawable = theme.resolveDrawableAttribute(R.attr.messageListForwarded) private val answeredIcon: Drawable = theme.resolveDrawableAttribute(R.attr.messageListAnswered) private val forwardedAnsweredIcon: Drawable = theme.resolveDrawableAttribute(R.attr.messageListAnsweredForwarded) private val activeItemBackgroundColor: Int = theme.resolveColorAttribute(R.attr.messageListActiveItemBackgroundColor) private val selectedItemBackgroundColor: Int = theme.resolveColorAttribute(R.attr.messageListSelectedBackgroundColor) private val activeItemBackgroundColor: Int = theme.resolveColorAttribute(R.attr.messageListActiveItemBackgroundColor) private val selectedItemBackgroundColor: Int = theme.resolveColorAttribute(R.attr.messageListSelectedBackgroundColor) private val readItemBackgroundColor: Int = theme.resolveColorAttribute(R.attr.messageListReadItemBackgroundColor) private val unreadItemBackgroundColor: Int = theme.resolveColorAttribute(R.attr.messageListUnreadItemBackgroundColor) private val unreadItemBackgroundColor: Int = theme.resolveColorAttribute(R.attr.messageListUnreadItemBackgroundColor) var messages: List<MessageListItem> = emptyList() set(value) { Loading Loading @@ -96,19 +99,15 @@ class MessageListAdapter internal constructor( override fun getItem(position: Int): MessageListItem = messages[position] override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View { val message = getItem(position) val view: View = convertView ?: newView(parent) if(!message.displayName.trim().toString().equals(res.getString(R.string.general_no_subject)) && !message.subject?.trim().toString().equals(res.getString(R.string.general_no_subject))){ bindView(view, context, message) } return view } Loading @@ -130,7 +129,10 @@ class MessageListAdapter internal constructor( holder.preview.setLines(max(appearance.previewLines, 0)) appearance.fontSizes.setViewTextSize(holder.displayName, appearance.fontSizes.messageListSender) appearance.fontSizes.setViewTextSize(holder.preview, appearance.fontSizes.messageListPreview) appearance.fontSizes.setViewTextSize(holder.threadCount, appearance.fontSizes.messageListSubject) // thread count is next to subject appearance.fontSizes.setViewTextSize( holder.threadCount, appearance.fontSizes.messageListSubject ) // thread count is next to subject holder.flagged.isVisible = false holder.flagged.tag = holder Loading @@ -142,6 +144,14 @@ class MessageListAdapter internal constructor( } private fun bindView(view: View, context: Context, message: MessageListItem) { if (message.displayName.trim().toString().equals(res.getString(R.string.general_no_subject)) && message.subject?.trim().toString().equals(res.getString(R.string.general_no_subject)) ) { view.setVisibility(View.GONE) return } val isSelected = selected.contains(message.uniqueId) val isActive = isActiveMessage(message) Loading Loading
app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListAdapter.kt +20 −10 Original line number Diff line number Diff line Loading @@ -47,10 +47,13 @@ class MessageListAdapter internal constructor( private val forwardedIcon: Drawable = theme.resolveDrawableAttribute(R.attr.messageListForwarded) private val answeredIcon: Drawable = theme.resolveDrawableAttribute(R.attr.messageListAnswered) private val forwardedAnsweredIcon: Drawable = theme.resolveDrawableAttribute(R.attr.messageListAnsweredForwarded) private val activeItemBackgroundColor: Int = theme.resolveColorAttribute(R.attr.messageListActiveItemBackgroundColor) private val selectedItemBackgroundColor: Int = theme.resolveColorAttribute(R.attr.messageListSelectedBackgroundColor) private val activeItemBackgroundColor: Int = theme.resolveColorAttribute(R.attr.messageListActiveItemBackgroundColor) private val selectedItemBackgroundColor: Int = theme.resolveColorAttribute(R.attr.messageListSelectedBackgroundColor) private val readItemBackgroundColor: Int = theme.resolveColorAttribute(R.attr.messageListReadItemBackgroundColor) private val unreadItemBackgroundColor: Int = theme.resolveColorAttribute(R.attr.messageListUnreadItemBackgroundColor) private val unreadItemBackgroundColor: Int = theme.resolveColorAttribute(R.attr.messageListUnreadItemBackgroundColor) var messages: List<MessageListItem> = emptyList() set(value) { Loading Loading @@ -96,19 +99,15 @@ class MessageListAdapter internal constructor( override fun getItem(position: Int): MessageListItem = messages[position] override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View { val message = getItem(position) val view: View = convertView ?: newView(parent) if(!message.displayName.trim().toString().equals(res.getString(R.string.general_no_subject)) && !message.subject?.trim().toString().equals(res.getString(R.string.general_no_subject))){ bindView(view, context, message) } return view } Loading @@ -130,7 +129,10 @@ class MessageListAdapter internal constructor( holder.preview.setLines(max(appearance.previewLines, 0)) appearance.fontSizes.setViewTextSize(holder.displayName, appearance.fontSizes.messageListSender) appearance.fontSizes.setViewTextSize(holder.preview, appearance.fontSizes.messageListPreview) appearance.fontSizes.setViewTextSize(holder.threadCount, appearance.fontSizes.messageListSubject) // thread count is next to subject appearance.fontSizes.setViewTextSize( holder.threadCount, appearance.fontSizes.messageListSubject ) // thread count is next to subject holder.flagged.isVisible = false holder.flagged.tag = holder Loading @@ -142,6 +144,14 @@ class MessageListAdapter internal constructor( } private fun bindView(view: View, context: Context, message: MessageListItem) { if (message.displayName.trim().toString().equals(res.getString(R.string.general_no_subject)) && message.subject?.trim().toString().equals(res.getString(R.string.general_no_subject)) ) { view.setVisibility(View.GONE) return } val isSelected = selected.contains(message.uniqueId) val isActive = isActiveMessage(message) Loading