Add theming to deck card image

Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
sowjanyakch 2024-10-10 20:20:48 +02:00
parent de420a3a30
commit 305a66ef5a
No known key found for this signature in database
GPG key ID: F7AA2A8B65B50220
2 changed files with 18 additions and 8 deletions

View file

@ -14,6 +14,7 @@ import android.net.Uri
import android.text.TextUtils
import android.util.Log
import android.view.View
import android.widget.ImageView
import androidx.core.content.ContextCompat
import autodagger.AutoInjector
import coil.load
@ -87,6 +88,10 @@ class IncomingDeckCardViewHolder(incomingView: View, payload: Any) : MessageHold
colorizeMessageBubble(message)
binding.cardView.findViewById<ImageView>(R.id.deckCardImage)?.let {
viewThemeUtils.platform.colorImageView(it, ColorRole.SECONDARY)
}
itemView.isSelected = false
// parent message handling

View file

@ -8,36 +8,37 @@
package com.nextcloud.talk.adapters.messages
import android.annotation.SuppressLint
import android.view.View
import autodagger.AutoInjector
import com.nextcloud.talk.application.NextcloudTalkApplication
import com.nextcloud.talk.chat.data.model.ChatMessage
import com.nextcloud.talk.databinding.ItemCustomOutcomingDeckCardMessageBinding
import com.stfalcon.chatkit.messages.MessageHolders
import javax.inject.Inject
import android.content.Context
import android.content.Intent
import android.net.Uri
import android.util.Log
import android.view.View
import android.widget.ImageView
import androidx.appcompat.content.res.AppCompatResources
import androidx.core.content.ContextCompat
import autodagger.AutoInjector
import coil.load
import com.nextcloud.android.common.ui.theme.utils.ColorRole
import com.nextcloud.talk.R
import com.nextcloud.talk.api.NcApi
import com.nextcloud.talk.application.NextcloudTalkApplication
import com.nextcloud.talk.application.NextcloudTalkApplication.Companion.sharedApplication
import com.nextcloud.talk.chat.ChatActivity
import com.nextcloud.talk.chat.data.model.ChatMessage
import com.nextcloud.talk.databinding.ItemCustomOutcomingDeckCardMessageBinding
import com.nextcloud.talk.models.json.chat.ReadStatus
import com.nextcloud.talk.ui.theme.ViewThemeUtils
import com.nextcloud.talk.utils.ApiUtils
import com.nextcloud.talk.utils.message.MessageUtils
import com.nextcloud.talk.utils.DateUtils
import com.nextcloud.talk.utils.message.MessageUtils
import com.nextcloud.talk.utils.preferences.AppPreferences
import com.stfalcon.chatkit.messages.MessageHolders
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import javax.inject.Inject
@AutoInjector(NextcloudTalkApplication::class)
class OutgoingDeckCardViewHolder(
@ -85,6 +86,10 @@ class OutgoingDeckCardViewHolder(
colorizeMessageBubble(message)
binding.cardView.findViewById<ImageView>(R.id.deckCardImage)?.let {
viewThemeUtils.platform.colorImageView(it, ColorRole.SECONDARY)
}
itemView.isSelected = false
showDeckCard(message)