diff --git a/vector/src/main/java/im/vector/riotx/core/epoxy/profiles/ProfileActionItem.kt b/vector/src/main/java/im/vector/riotx/core/epoxy/profiles/ProfileActionItem.kt index 9816a480e2..27586fcfde 100644 --- a/vector/src/main/java/im/vector/riotx/core/epoxy/profiles/ProfileActionItem.kt +++ b/vector/src/main/java/im/vector/riotx/core/epoxy/profiles/ProfileActionItem.kt @@ -16,11 +16,13 @@ package im.vector.riotx.core.epoxy.profiles +import android.content.res.ColorStateList import android.view.View import android.widget.ImageView import android.widget.TextView import androidx.core.content.ContextCompat import androidx.core.view.isVisible +import androidx.core.widget.ImageViewCompat import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass import im.vector.riotx.R @@ -68,13 +70,20 @@ abstract class ProfileActionItem : VectorEpoxyModel() holder.subtitle.setTextOrHide(subtitle) if (iconRes != 0) { holder.icon.setImageResource(iconRes) + ImageViewCompat.setImageTintList(holder.icon, ColorStateList.valueOf(tintColor)) holder.icon.isVisible = true } else { holder.icon.isVisible = false } if (editableRes != 0) { + val tintColorSecondary = if (destructive) { + tintColor + } else { + ThemeUtils.getColor(holder.view.context, R.attr.riotx_text_secondary) + } holder.editable.setImageResource(editableRes) + ImageViewCompat.setImageTintList(holder.editable, ColorStateList.valueOf(tintColorSecondary)) holder.editable.isVisible = true } else { holder.editable.isVisible = false diff --git a/vector/src/main/java/im/vector/riotx/core/epoxy/profiles/ProfileItemExtensions.kt b/vector/src/main/java/im/vector/riotx/core/epoxy/profiles/ProfileItemExtensions.kt index 7dce5e15d3..beea3ca620 100644 --- a/vector/src/main/java/im/vector/riotx/core/epoxy/profiles/ProfileItemExtensions.kt +++ b/vector/src/main/java/im/vector/riotx/core/epoxy/profiles/ProfileItemExtensions.kt @@ -46,9 +46,7 @@ fun EpoxyController.buildProfileAction( id("action_$id") subtitle(subtitle) editable(editable) - apply { - editableRes?.let { editableRes(editableRes) } - } + editableRes?.let { editableRes(editableRes) } destructive(destructive) title(title) listener { _ -> diff --git a/vector/src/main/res/layout/item_profile_action.xml b/vector/src/main/res/layout/item_profile_action.xml index a2499f2e83..f584a001d0 100644 --- a/vector/src/main/res/layout/item_profile_action.xml +++ b/vector/src/main/res/layout/item_profile_action.xml @@ -20,6 +20,7 @@ android:layout_height="wrap_content" android:layout_centerVertical="true" android:scaleType="center" + android:tint="?riotx_text_primary" android:visibility="gone" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -55,7 +56,6 @@ android:layout_marginEnd="16dp" android:drawablePadding="16dp" android:ellipsize="end" - android:maxLines="2" android:textColor="?riotx_text_secondary" android:textSize="12sp" app:layout_constrainedWidth="true"