Threading-related theming

Change-Id: Idec928fa03c60235e2723c22139c6247020ef7b0
This commit is contained in:
SpiritCroc 2022-03-02 15:20:25 +01:00
parent f06ae844dc
commit 7ff40cb22d
6 changed files with 22 additions and 10 deletions

View file

@ -1174,7 +1174,7 @@ class TimelineFragment @Inject constructor(
badgeFrameLayout.isVisible = true badgeFrameLayout.isVisible = true
badgeTextView.text = unreadThreadMessages.toString() badgeTextView.text = unreadThreadMessages.toString()
val badgeDrawable = DrawableCompat.wrap(badgeFrameLayout.background) val badgeDrawable = DrawableCompat.wrap(badgeFrameLayout.background)
val color = ContextCompat.getColor(requireContext(), if (userIsMentioned) R.color.palette_vermilion else R.color.palette_gray_200) val color = ThemeUtils.getColor(requireContext(), if (userIsMentioned) R.attr.colorError else R.attr.colorAccent)
DrawableCompat.setTint(badgeDrawable, color) DrawableCompat.setTint(badgeDrawable, color)
badgeFrameLayout.background = badgeDrawable badgeFrameLayout.background = badgeDrawable
} else { } else {

View file

@ -33,6 +33,7 @@ import im.vector.app.core.extensions.setLeftDrawable
import im.vector.app.core.utils.DimensionConverter import im.vector.app.core.utils.DimensionConverter
import im.vector.app.features.displayname.getBestName import im.vector.app.features.displayname.getBestName
import im.vector.app.features.home.AvatarRenderer import im.vector.app.features.home.AvatarRenderer
import im.vector.app.features.themes.ThemeUtils
import org.matrix.android.sdk.api.session.threads.ThreadNotificationState import org.matrix.android.sdk.api.session.threads.ThreadNotificationState
import org.matrix.android.sdk.api.util.MatrixItem import org.matrix.android.sdk.api.util.MatrixItem
@ -80,11 +81,11 @@ abstract class ThreadListItem : VectorEpoxyModel<ThreadListItem.Holder>() {
when (threadNotificationState) { when (threadNotificationState) {
ThreadNotificationState.NEW_MESSAGE -> { ThreadNotificationState.NEW_MESSAGE -> {
holder.unreadImageView.isVisible = true holder.unreadImageView.isVisible = true
holder.unreadImageView.setColorFilter(ContextCompat.getColor(holder.view.context, R.color.palette_gray_200)) holder.unreadImageView.setColorFilter(ThemeUtils.getColor(holder.view.context, R.attr.colorAccent))
} }
ThreadNotificationState.NEW_HIGHLIGHTED_MESSAGE -> { ThreadNotificationState.NEW_HIGHLIGHTED_MESSAGE -> {
holder.unreadImageView.isVisible = true holder.unreadImageView.isVisible = true
holder.unreadImageView.setColorFilter(ContextCompat.getColor(holder.view.context, R.color.palette_vermilion)) holder.unreadImageView.setColorFilter(ThemeUtils.getColor(holder.view.context, R.attr.colorError))
} }
else -> { else -> {
holder.unreadImageView.isVisible = false holder.unreadImageView.isVisible = false

View file

@ -0,0 +1,11 @@
<vector android:height="16dp" android:viewportHeight="18"
android:viewportWidth="18" android:width="16dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="?riotx_unread_unimportant_room_badge" android:pathData="M14.9995,1H2.9995C1.8949,1 0.9995,1.8954 0.9995,3V14V17L4.4662,14.4C4.8124,14.1404 5.2334,14 5.6662,14H6.9995H14.9995C16.1041,14 16.9995,13.1046 16.9995,12V8V2.9994C16.9995,1.8948 16.1041,1 14.9995,1Z"/>
<path android:fillColor="?riotx_unread_unimportant_room_badge" android:pathData="M4.4662,14.4L4.0162,13.8H4.0162L4.4662,14.4ZM0.9995,17H0.2495C0.2495,17.2841 0.41,17.5438 0.6641,17.6708C0.9182,17.7979 1.2222,17.7704 1.4495,17.6L0.9995,17ZM2.9995,1.75H14.9995V0.25H2.9995V1.75ZM1.7495,14V3H0.2495V14H1.7495ZM16.2495,2.9994V8H17.7495V2.9994H16.2495ZM4.0162,13.8L0.5495,16.4L1.4495,17.6L4.9162,15L4.0162,13.8ZM1.7495,17V14H0.2495V17H1.7495ZM5.6662,14.75H6.9995V13.25H5.6662V14.75ZM6.9995,14.75H14.9995V13.25H6.9995V14.75ZM17.7495,12V8H16.2495V12H17.7495ZM14.9995,14.75C16.5183,14.75 17.7495,13.5188 17.7495,12H16.2495C16.2495,12.6904 15.6899,13.25 14.9995,13.25V14.75ZM4.9162,15C5.1325,14.8377 5.3957,14.75 5.6662,14.75V13.25C5.0712,13.25 4.4922,13.443 4.0162,13.8L4.9162,15ZM14.9995,1.75C15.6902,1.75 16.2495,2.3093 16.2495,2.9994H17.7495C17.7495,1.4803 16.518,0.25 14.9995,0.25V1.75ZM2.9995,0.25C1.4807,0.25 0.2495,1.4812 0.2495,3H1.7495C1.7495,2.3096 2.3092,1.75 2.9995,1.75V0.25Z"/>
<path android:fillColor="#00000000"
android:pathData="M4.9995,6C4.9995,6 9.0943,6 12.9995,6"
android:strokeColor="#ffffff" android:strokeLineCap="round" android:strokeWidth="1.5"/>
<path android:fillColor="#00000000"
android:pathData="M4.9995,9H8.9995"
android:strokeColor="#ffffff" android:strokeLineCap="round" android:strokeWidth="1.5"/>
</vector>

View file

@ -1,11 +1,11 @@
<vector android:height="16dp" android:viewportHeight="18" <vector android:height="16dp" android:viewportHeight="18"
android:viewportWidth="18" android:width="16dp" xmlns:android="http://schemas.android.com/apk/res/android"> android:viewportWidth="18" android:width="16dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#737D8C" android:pathData="M14.9995,1H2.9995C1.8949,1 0.9995,1.8954 0.9995,3V14V17L4.4662,14.4C4.8124,14.1404 5.2334,14 5.6662,14H6.9995H14.9995C16.1041,14 16.9995,13.1046 16.9995,12V8V2.9994C16.9995,1.8948 16.1041,1 14.9995,1Z"/> <path android:fillColor="#808080" android:pathData="M14.9995,1H2.9995C1.8949,1 0.9995,1.8954 0.9995,3V14V17L4.4662,14.4C4.8124,14.1404 5.2334,14 5.6662,14H6.9995H14.9995C16.1041,14 16.9995,13.1046 16.9995,12V8V2.9994C16.9995,1.8948 16.1041,1 14.9995,1Z"/>
<path android:fillColor="#737D8C" android:pathData="M4.4662,14.4L4.0162,13.8H4.0162L4.4662,14.4ZM0.9995,17H0.2495C0.2495,17.2841 0.41,17.5438 0.6641,17.6708C0.9182,17.7979 1.2222,17.7704 1.4495,17.6L0.9995,17ZM2.9995,1.75H14.9995V0.25H2.9995V1.75ZM1.7495,14V3H0.2495V14H1.7495ZM16.2495,2.9994V8H17.7495V2.9994H16.2495ZM4.0162,13.8L0.5495,16.4L1.4495,17.6L4.9162,15L4.0162,13.8ZM1.7495,17V14H0.2495V17H1.7495ZM5.6662,14.75H6.9995V13.25H5.6662V14.75ZM6.9995,14.75H14.9995V13.25H6.9995V14.75ZM17.7495,12V8H16.2495V12H17.7495ZM14.9995,14.75C16.5183,14.75 17.7495,13.5188 17.7495,12H16.2495C16.2495,12.6904 15.6899,13.25 14.9995,13.25V14.75ZM4.9162,15C5.1325,14.8377 5.3957,14.75 5.6662,14.75V13.25C5.0712,13.25 4.4922,13.443 4.0162,13.8L4.9162,15ZM14.9995,1.75C15.6902,1.75 16.2495,2.3093 16.2495,2.9994H17.7495C17.7495,1.4803 16.518,0.25 14.9995,0.25V1.75ZM2.9995,0.25C1.4807,0.25 0.2495,1.4812 0.2495,3H1.7495C1.7495,2.3096 2.3092,1.75 2.9995,1.75V0.25Z"/> <path android:fillColor="#808080" android:pathData="M4.4662,14.4L4.0162,13.8H4.0162L4.4662,14.4ZM0.9995,17H0.2495C0.2495,17.2841 0.41,17.5438 0.6641,17.6708C0.9182,17.7979 1.2222,17.7704 1.4495,17.6L0.9995,17ZM2.9995,1.75H14.9995V0.25H2.9995V1.75ZM1.7495,14V3H0.2495V14H1.7495ZM16.2495,2.9994V8H17.7495V2.9994H16.2495ZM4.0162,13.8L0.5495,16.4L1.4495,17.6L4.9162,15L4.0162,13.8ZM1.7495,17V14H0.2495V17H1.7495ZM5.6662,14.75H6.9995V13.25H5.6662V14.75ZM6.9995,14.75H14.9995V13.25H6.9995V14.75ZM17.7495,12V8H16.2495V12H17.7495ZM14.9995,14.75C16.5183,14.75 17.7495,13.5188 17.7495,12H16.2495C16.2495,12.6904 15.6899,13.25 14.9995,13.25V14.75ZM4.9162,15C5.1325,14.8377 5.3957,14.75 5.6662,14.75V13.25C5.0712,13.25 4.4922,13.443 4.0162,13.8L4.9162,15ZM14.9995,1.75C15.6902,1.75 16.2495,2.3093 16.2495,2.9994H17.7495C17.7495,1.4803 16.518,0.25 14.9995,0.25V1.75ZM2.9995,0.25C1.4807,0.25 0.2495,1.4812 0.2495,3H1.7495C1.7495,2.3096 2.3092,1.75 2.9995,1.75V0.25Z"/>
<path android:fillColor="#00000000" <path android:fillColor="#00000000"
android:pathData="M4.9995,6C4.9995,6 9.0943,6 12.9995,6" android:pathData="M4.9995,6C4.9995,6 9.0943,6 12.9995,6"
android:strokeColor="#F4F6FA" android:strokeLineCap="round" android:strokeWidth="1.5"/> android:strokeColor="#ffffff" android:strokeLineCap="round" android:strokeWidth="1.5"/>
<path android:fillColor="#00000000" <path android:fillColor="#00000000"
android:pathData="M4.9995,9H8.9995" android:pathData="M4.9995,9H8.9995"
android:strokeColor="#F4F6FA" android:strokeLineCap="round" android:strokeWidth="1.5"/> android:strokeColor="#ffffff" android:strokeLineCap="round" android:strokeWidth="1.5"/>
</vector> </vector>

View file

@ -64,7 +64,7 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/threadSummaryDateTextView" app:layout_constraintStart_toEndOf="@id/threadSummaryDateTextView"
app:layout_constraintTop_toTopOf="@id/threadSummaryDateTextView" app:layout_constraintTop_toTopOf="@id/threadSummaryDateTextView"
app:tint="@color/palette_gray_200" app:tint="?riotx_unread_unimportant_room_badge"
tools:ignore="ContentDescription" tools:ignore="ContentDescription"
tools:visibility="visible" /> tools:visibility="visible" />

View file

@ -31,7 +31,7 @@
android:paddingStart="2dp" android:paddingStart="2dp"
android:paddingEnd="2dp" android:paddingEnd="2dp"
android:layout_gravity="top|end" android:layout_gravity="top|end"
android:backgroundTint="@color/palette_gray_200" android:backgroundTint="?riotx_unread_unimportant_room_badge"
android:background="@drawable/notification_badge" android:background="@drawable/notification_badge"
android:visibility="visible" android:visibility="visible"
tools:visibility="visible"> tools:visibility="visible">