mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-11 14:54:09 +01:00
use light textcolor for reactions for outgoing message
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
3f987fcdad
commit
07299bb32a
@ -102,7 +102,7 @@ class IncomingLocationMessageViewHolder(incomingView: View, payload: Any) : Mess
|
||||
// geo-location
|
||||
setLocationDataOnMessageItem(message)
|
||||
|
||||
Reaction().showReactions(message, binding.reactions, context!!)
|
||||
Reaction().showReactions(message, binding.reactions, context!!, false)
|
||||
|
||||
binding.reactions.reactionsEmojiWrapper.setOnClickListener {
|
||||
reactionsInterface.onClickReactions(message)
|
||||
|
@ -142,7 +142,7 @@ class IncomingVoiceMessageViewHolder(incomingView: View, payload: Any) : Message
|
||||
}
|
||||
})
|
||||
|
||||
Reaction().showReactions(message, binding.reactions, context!!)
|
||||
Reaction().showReactions(message, binding.reactions, context!!, false)
|
||||
|
||||
binding.reactions.reactionsEmojiWrapper.setOnClickListener {
|
||||
reactionsInterface.onClickReactions(message)
|
||||
|
@ -122,7 +122,7 @@ class MagicIncomingTextMessageViewHolder(itemView: View, payload: Any) : Message
|
||||
|
||||
itemView.setTag(MessageSwipeCallback.REPLYABLE_VIEW_TAG, message.isReplyable)
|
||||
|
||||
Reaction().showReactions(message, binding.reactions, context!!)
|
||||
Reaction().showReactions(message, binding.reactions, context!!, false)
|
||||
|
||||
binding.reactions.reactionsEmojiWrapper.setOnClickListener {
|
||||
reactionsInterface.onClickReactions(message)
|
||||
|
@ -121,7 +121,7 @@ class MagicOutcomingTextMessageViewHolder(itemView: View) : OutcomingTextMessage
|
||||
|
||||
itemView.setTag(MessageSwipeCallback.REPLYABLE_VIEW_TAG, message.isReplyable)
|
||||
|
||||
Reaction().showReactions(message, binding.reactions, context!!)
|
||||
Reaction().showReactions(message, binding.reactions, context!!, true)
|
||||
|
||||
binding.reactions.reactionsEmojiWrapper.setOnClickListener {
|
||||
reactionsInterface.onClickReactions(message)
|
||||
|
@ -259,7 +259,7 @@ public abstract class MagicPreviewMessageViewHolder extends MessageHolders.Incom
|
||||
itemView.setTag(REPLYABLE_VIEW_TAG, message.isReplyable());
|
||||
|
||||
reactionsBinding = getReactionsBinding();
|
||||
new Reaction().showReactions(message, reactionsBinding, context);
|
||||
new Reaction().showReactions(message, reactionsBinding, context, false);
|
||||
|
||||
reactionsBinding.reactionsEmojiWrapper.setOnClickListener(l -> {
|
||||
reactionsInterface.onClickReactions(message);
|
||||
|
@ -114,7 +114,7 @@ class OutcomingLocationMessageViewHolder(incomingView: View) : MessageHolders
|
||||
// geo-location
|
||||
setLocationDataOnMessageItem(message)
|
||||
|
||||
Reaction().showReactions(message, binding.reactions, context!!)
|
||||
Reaction().showReactions(message, binding.reactions, context!!, true)
|
||||
|
||||
binding.reactions.reactionsEmojiWrapper.setOnClickListener {
|
||||
reactionsInterface.onClickReactions(message)
|
||||
|
@ -131,7 +131,7 @@ class OutcomingVoiceMessageViewHolder(outcomingView: View) : MessageHolders
|
||||
|
||||
binding.checkMark.setContentDescription(readStatusContentDescriptionString)
|
||||
|
||||
Reaction().showReactions(message, binding.reactions, context!!)
|
||||
Reaction().showReactions(message, binding.reactions, context!!, true)
|
||||
|
||||
binding.reactions.reactionsEmojiWrapper.setOnClickListener {
|
||||
reactionsInterface.onClickReactions(message)
|
||||
|
@ -27,13 +27,20 @@ import android.content.Context
|
||||
import android.view.ViewGroup
|
||||
import android.widget.RelativeLayout
|
||||
import android.widget.TextView
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.nextcloud.talk.R
|
||||
import com.nextcloud.talk.databinding.ReactionsInsideMessageBinding
|
||||
import com.nextcloud.talk.models.json.chat.ChatMessage
|
||||
import com.nextcloud.talk.utils.DisplayUtils
|
||||
import com.vanniktech.emoji.EmojiTextView
|
||||
|
||||
class Reaction {
|
||||
fun showReactions(message: ChatMessage, binding: ReactionsInsideMessageBinding, context: Context) {
|
||||
fun showReactions(
|
||||
message: ChatMessage,
|
||||
binding: ReactionsInsideMessageBinding,
|
||||
context: Context,
|
||||
useLightColorForText: Boolean
|
||||
) {
|
||||
binding.reactionsEmojiWrapper.removeAllViews()
|
||||
if (message.reactions != null && message.reactions.isNotEmpty()) {
|
||||
|
||||
@ -44,6 +51,10 @@ class Reaction {
|
||||
reactionEmoji.text = emoji
|
||||
|
||||
val reactionAmount = TextView(context)
|
||||
if (useLightColorForText){
|
||||
reactionAmount.setTextColor(ContextCompat.getColor(context, R.color.nc_grey))
|
||||
}
|
||||
|
||||
reactionAmount.text = amount.toString()
|
||||
|
||||
val params = RelativeLayout.LayoutParams(
|
||||
|
Loading…
Reference in New Issue
Block a user