Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 3a158a7c authored by cketti's avatar cketti Committed by GitHub
Browse files

Merge pull request #4177 from k9mail/change_account_chip

Change shape and position of account chip in message list
parents d1f15430 00f6d7ea
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ import android.view.View
import android.view.ViewGroup
import android.widget.CursorAdapter
import android.widget.TextView
import androidx.core.graphics.drawable.DrawableCompat
import androidx.core.view.isVisible

import com.fsck.k9.Account
@@ -190,7 +191,10 @@ class MessageListAdapter internal constructor(
        val uniqueId = cursor.getLong(uniqueIdColumn)
        val selected = selected.contains(uniqueId)

        holder.chip.setBackgroundColor(account.chipColor)
        val accountChipDrawable = holder.chip.drawable.mutate()
        DrawableCompat.setTint(accountChipDrawable, account.chipColor)
        holder.chip.setImageDrawable(accountChipDrawable)

        if (appearance.stars) {
            holder.flagged.isChecked = flagged
        }
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ class MessageViewHolder(
    val subject: TextView = view.findViewById(R.id.subject)
    val preview: TextView = view.findViewById(R.id.preview)
    val date: TextView = view.findViewById(R.id.date)
    val chip: View = view.findViewById(R.id.chip)
    val chip: ImageView = view.findViewById(R.id.account_color_chip)
    val threadCount: TextView = view.findViewById(R.id.thread_count)
    val flagged: CheckBox = view.findViewById(R.id.star)
    val attachment: ImageView = view.findViewById(R.id.attachment)
+10 −0
Original line number Diff line number Diff line
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="4dp"
    android:height="14dp"
    android:viewportWidth="4"
    android:viewportHeight="14">
  <path
      android:fillColor="#000000"
      android:pathData="M 2 0 C 2 0, 4 0, 4 2 V 12 C 4 14 2 14 2 14 C 2 14 0 14 0 12 V 2 C 0 0 2 0 2 0 Z"
      android:fillAlpha="1"/>
</vector>
+10 −10
Original line number Diff line number Diff line
@@ -7,23 +7,15 @@
              android:layout_gravity="center_vertical"
        >

    <View
            android:id="@+id/chip"
            android:adjustViewBounds="false"
            android:layout_height="match_parent"
            android:layout_width="8dip"
            android:layout_marginRight="4dp"
            />

    <com.fsck.k9.ui.ContactBadge
            android:id="@+id/contact_badge"
            android:layout_marginRight="8dip"
            android:layout_marginRight="16dp"
            android:layout_marginTop="4dip"
            android:layout_marginBottom="3dip"
            android:layout_height="40dip"
            android:layout_width="40dip"
            android:layout_gravity="center_vertical"
            android:layout_marginLeft="4dp"
            android:layout_marginLeft="16dp"
            tools:src="@drawable/ic_contact_picture"
            android:background="@android:color/transparent"/>

@@ -74,6 +66,14 @@
                android:layout_toLeftOf="@+id/attachment"
                android:layout_toRightOf="@+id/status">

            <ImageView
                android:id="@+id/account_color_chip"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:layout_marginRight="4dp"
                android:src="@drawable/ic_account_color" />

            <TextView
                    android:id="@+id/subject"
                    android:layout_width="0dp"
+0 −5
Original line number Diff line number Diff line
package com.fsck.k9

import android.graphics.drawable.ColorDrawable
import android.view.View
import android.widget.TextView


val TextView.textString: String
    get() = text.toString()

val View.backgroundColor: Int
    get() = (background as ColorDrawable).color
Loading