mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-09 13:59:48 +01:00
label styling
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
parent
a133804f65
commit
f418955e1d
@ -35,7 +35,7 @@ class ChatUtils {
|
|||||||
resultMessage?.replace("{$key}", "@" + individualHashMap["name"])
|
resultMessage?.replace("{$key}", "@" + individualHashMap["name"])
|
||||||
} else if (type == "geo-location") {
|
} else if (type == "geo-location") {
|
||||||
individualHashMap["name"]
|
individualHashMap["name"]
|
||||||
} else if (individualHashMap.containsKey("link") == true) {
|
} else if (individualHashMap.containsKey("link")) {
|
||||||
if (type == "file") {
|
if (type == "file") {
|
||||||
resultMessage?.replace("{$key}", individualHashMap["name"].toString())
|
resultMessage?.replace("{$key}", individualHashMap["name"].toString())
|
||||||
} else {
|
} else {
|
||||||
|
@ -8,12 +8,12 @@ package com.nextcloud.talk.utils.message
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.graphics.Color
|
import android.graphics.Typeface
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.text.SpannableString
|
import android.text.SpannableString
|
||||||
import android.text.SpannableStringBuilder
|
import android.text.SpannableStringBuilder
|
||||||
import android.text.Spanned
|
import android.text.Spanned
|
||||||
import android.text.style.ForegroundColorSpan
|
import android.text.style.StyleSpan
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import com.nextcloud.talk.R
|
import com.nextcloud.talk.R
|
||||||
@ -152,13 +152,12 @@ class MessageUtils(val context: Context) {
|
|||||||
val end = start + placeholder.length
|
val end = start + placeholder.length
|
||||||
spannable.replace(start, end, replacementText)
|
spannable.replace(start, end, replacementText)
|
||||||
spannable.setSpan(
|
spannable.setSpan(
|
||||||
ForegroundColorSpan(Color.BLUE),
|
StyleSpan(Typeface.BOLD),
|
||||||
start,
|
start,
|
||||||
start + replacementText!!
|
start + replacementText!!
|
||||||
.length,
|
.length,
|
||||||
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
|
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
|
||||||
)
|
)
|
||||||
|
|
||||||
start = spannable.indexOf(placeholder, start + replacementText.length)
|
start = spannable.indexOf(placeholder, start + replacementText.length)
|
||||||
}
|
}
|
||||||
messageStringInternal = spannable
|
messageStringInternal = spannable
|
||||||
@ -166,7 +165,6 @@ class MessageUtils(val context: Context) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return messageStringInternal
|
return messageStringInternal
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user