label styling

Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
sowjanyakch 2025-02-10 13:16:40 +01:00
parent a133804f65
commit f418955e1d
No known key found for this signature in database
GPG Key ID: F7AA2A8B65B50220
2 changed files with 4 additions and 6 deletions

View File

@ -35,7 +35,7 @@ class ChatUtils {
resultMessage?.replace("{$key}", "@" + individualHashMap["name"])
} else if (type == "geo-location") {
individualHashMap["name"]
} else if (individualHashMap.containsKey("link") == true) {
} else if (individualHashMap.containsKey("link")) {
if (type == "file") {
resultMessage?.replace("{$key}", individualHashMap["name"].toString())
} else {

View File

@ -8,12 +8,12 @@ package com.nextcloud.talk.utils.message
import android.content.Context
import android.content.Intent
import android.graphics.Color
import android.graphics.Typeface
import android.net.Uri
import android.text.SpannableString
import android.text.SpannableStringBuilder
import android.text.Spanned
import android.text.style.ForegroundColorSpan
import android.text.style.StyleSpan
import android.util.Log
import android.view.View
import com.nextcloud.talk.R
@ -152,13 +152,12 @@ class MessageUtils(val context: Context) {
val end = start + placeholder.length
spannable.replace(start, end, replacementText)
spannable.setSpan(
ForegroundColorSpan(Color.BLUE),
StyleSpan(Typeface.BOLD),
start,
start + replacementText!!
.length,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
start = spannable.indexOf(placeholder, start + replacementText.length)
}
messageStringInternal = spannable
@ -166,7 +165,6 @@ class MessageUtils(val context: Context) {
}
}
}
return messageStringInternal
}