Loading app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListAdapter.kt +21 −4 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ import android.content.res.Resources.Theme import android.graphics.Color import android.graphics.Typeface import android.graphics.drawable.Drawable import android.opengl.Visibility import android.text.Spannable import android.text.style.AbsoluteSizeSpan import android.text.style.StyleSpan Loading Loading @@ -46,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 @@ -98,6 +102,7 @@ class MessageListAdapter internal constructor( override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View { val message = getItem(position) val view: View = convertView ?: newView(parent) bindView(view, context, message) return view Loading @@ -120,7 +125,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 @@ -132,6 +140,14 @@ class MessageListAdapter internal constructor( } private fun bindView(view: View, context: Context, message: MessageListItem) { if (message.displayName.trim().toString().equals(res.getString(R.string.unknown_sender)) && message.subject?.trim().toString().equals(res.getString(R.string.general_no_subject)) ) { view.setVisibility(View.GONE) return } view.setVisibility(View.VISIBLE) val isSelected = selected.contains(message.uniqueId) val isActive = isActiveMessage(message) Loading Loading @@ -202,6 +218,7 @@ class MessageListAdapter internal constructor( } else { holder.status.isVisible = false } } } Loading app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageViewHolder.kt +2 −0 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ package com.fsck.k9.fragment import android.view.View import android.widget.CheckBox import android.widget.ImageView import android.widget.LinearLayout import android.widget.TextView import com.fsck.k9.ui.R Loading @@ -20,4 +21,5 @@ class MessageViewHolder(view: View) { val flagged: CheckBox = view.findViewById(R.id.star) val attachment: ImageView = view.findViewById(R.id.attachment) val status: ImageView = view.findViewById(R.id.status) } app/ui/legacy/src/main/res/layout/message_list_item.xml +2 −1 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ android:layout_height="wrap_content" android:orientation="horizontal" android:layout_gravity="center_vertical" tools:layout_height="?android:attr/listPreferredItemHeight"> <FrameLayout Loading Loading
app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListAdapter.kt +21 −4 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ import android.content.res.Resources.Theme import android.graphics.Color import android.graphics.Typeface import android.graphics.drawable.Drawable import android.opengl.Visibility import android.text.Spannable import android.text.style.AbsoluteSizeSpan import android.text.style.StyleSpan Loading Loading @@ -46,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 @@ -98,6 +102,7 @@ class MessageListAdapter internal constructor( override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View { val message = getItem(position) val view: View = convertView ?: newView(parent) bindView(view, context, message) return view Loading @@ -120,7 +125,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 @@ -132,6 +140,14 @@ class MessageListAdapter internal constructor( } private fun bindView(view: View, context: Context, message: MessageListItem) { if (message.displayName.trim().toString().equals(res.getString(R.string.unknown_sender)) && message.subject?.trim().toString().equals(res.getString(R.string.general_no_subject)) ) { view.setVisibility(View.GONE) return } view.setVisibility(View.VISIBLE) val isSelected = selected.contains(message.uniqueId) val isActive = isActiveMessage(message) Loading Loading @@ -202,6 +218,7 @@ class MessageListAdapter internal constructor( } else { holder.status.isVisible = false } } } Loading
app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageViewHolder.kt +2 −0 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ package com.fsck.k9.fragment import android.view.View import android.widget.CheckBox import android.widget.ImageView import android.widget.LinearLayout import android.widget.TextView import com.fsck.k9.ui.R Loading @@ -20,4 +21,5 @@ class MessageViewHolder(view: View) { val flagged: CheckBox = view.findViewById(R.id.star) val attachment: ImageView = view.findViewById(R.id.attachment) val status: ImageView = view.findViewById(R.id.status) }
app/ui/legacy/src/main/res/layout/message_list_item.xml +2 −1 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ android:layout_height="wrap_content" android:orientation="horizontal" android:layout_gravity="center_vertical" tools:layout_height="?android:attr/listPreferredItemHeight"> <FrameLayout Loading