mirror of
https://github.com/element-hq/element-android
synced 2024-11-28 13:38:49 +03:00
Fix issue in dark theme. Also do not limit subtitles to 2 lines
This commit is contained in:
parent
96a556f449
commit
40b0f60964
3 changed files with 11 additions and 4 deletions
|
@ -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<ProfileActionItem.Holder>()
|
|||
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
|
||||
|
|
|
@ -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 { _ ->
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue