Skip to content

Commit

Permalink
fix color item
Browse files Browse the repository at this point in the history
  • Loading branch information
NadaFeteiha committed Nov 19, 2022
1 parent 0515700 commit d7aed9c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ data class MessageUi(
val textMessage: String = "",
val isFromMe: Boolean = true,
val time: String = "",
val color: String = "#66C16F"
)

data class ChatLayout(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class ChatViewModel @Inject constructor(
MessageUi(
message.textMessage,
isFromMe = message.fromMe,
color = brandColor.value,
time = timeConverter.convertLongToTime(message.time)
)
})
Expand Down
6 changes: 1 addition & 5 deletions app/src/main/res/layout/item_chat_sender.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@

<import type="android.graphics.Color"/>

<variable
name="viewModel"
type="com.thechance.whatschance.ui.chat.ChatViewModel" />

<variable
name="item"
type="com.thechance.whatschance.ui.chat.MessageUi" />
Expand All @@ -29,7 +25,7 @@
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:backgroundTint="@{Color.parseColor(viewModel.brandColor)}"
android:backgroundTint="@{Color.parseColor(item.color)}"
app:cardCornerRadius="@dimen/spacing_small">

<TextView
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ buildscript {


plugins {
id 'com.android.application' version '7.2.1' apply false
id 'com.android.library' version '7.2.1' apply false
id 'com.android.application' version '7.3.0' apply false
id 'com.android.library' version '7.3.0' apply false
id 'org.jetbrains.kotlin.android' version '1.7.10' apply false
}

0 comments on commit d7aed9c

Please sign in to comment.