mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-29 01:48:53 +03:00
Making reply length a const
Signed-off-by: Julius Linus <julius.linus@nextcloud.com> Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
a926c27ae7
commit
93da3a9c65
2 changed files with 4 additions and 4 deletions
|
@ -171,7 +171,6 @@ class IncomingTextMessageViewHolder(itemView: View, payload: Any) :
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun processParentMessage(message: ChatMessage) {
|
private fun processParentMessage(message: ChatMessage) {
|
||||||
val maxReplyLength = 250
|
|
||||||
val parentChatMessage = message.parentMessage
|
val parentChatMessage = message.parentMessage
|
||||||
parentChatMessage!!.activeUser = message.activeUser
|
parentChatMessage!!.activeUser = message.activeUser
|
||||||
parentChatMessage.imageUrl?.let {
|
parentChatMessage.imageUrl?.let {
|
||||||
|
@ -190,7 +189,7 @@ class IncomingTextMessageViewHolder(itemView: View, payload: Any) :
|
||||||
} else {
|
} else {
|
||||||
parentChatMessage.actorDisplayName
|
parentChatMessage.actorDisplayName
|
||||||
}
|
}
|
||||||
binding.messageQuote.quotedMessage.text = DisplayUtils.ellipsize(parentChatMessage.text, maxReplyLength)
|
binding.messageQuote.quotedMessage.text = DisplayUtils.ellipsize(parentChatMessage.text, MAX_REPLY_LENGTH)
|
||||||
|
|
||||||
if (parentChatMessage.actorId?.equals(message.activeUser!!.userId) == true) {
|
if (parentChatMessage.actorId?.equals(message.activeUser!!.userId) == true) {
|
||||||
viewThemeUtils.platform.colorViewBackground(binding.messageQuote.quoteColoredView)
|
viewThemeUtils.platform.colorViewBackground(binding.messageQuote.quoteColoredView)
|
||||||
|
@ -263,5 +262,6 @@ class IncomingTextMessageViewHolder(itemView: View, payload: Any) :
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val TEXT_SIZE_MULTIPLIER = 2.5
|
const val TEXT_SIZE_MULTIPLIER = 2.5
|
||||||
|
const val MAX_REPLY_LENGTH = 250
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -148,7 +148,6 @@ class OutcomingTextMessageViewHolder(itemView: View) : OutcomingTextMessageViewH
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun processParentMessage(message: ChatMessage) {
|
private fun processParentMessage(message: ChatMessage) {
|
||||||
val maxReplyLength = 250
|
|
||||||
val parentChatMessage = message.parentMessage
|
val parentChatMessage = message.parentMessage
|
||||||
val textColor = viewThemeUtils.getScheme(binding.messageQuote.quotedMessage.context).onSurfaceVariant
|
val textColor = viewThemeUtils.getScheme(binding.messageQuote.quotedMessage.context).onSurfaceVariant
|
||||||
parentChatMessage!!.activeUser = message.activeUser
|
parentChatMessage!!.activeUser = message.activeUser
|
||||||
|
@ -165,7 +164,7 @@ class OutcomingTextMessageViewHolder(itemView: View) : OutcomingTextMessageViewH
|
||||||
}
|
}
|
||||||
binding.messageQuote.quotedMessageAuthor.text = parentChatMessage.actorDisplayName
|
binding.messageQuote.quotedMessageAuthor.text = parentChatMessage.actorDisplayName
|
||||||
?: context!!.getText(R.string.nc_nick_guest)
|
?: context!!.getText(R.string.nc_nick_guest)
|
||||||
binding.messageQuote.quotedMessage.text = DisplayUtils.ellipsize(parentChatMessage.text, maxReplyLength)
|
binding.messageQuote.quotedMessage.text = DisplayUtils.ellipsize(parentChatMessage.text, MAX_REPLY_LENGTH)
|
||||||
|
|
||||||
binding.messageQuote.quotedMessageAuthor.setTextColor(textColor)
|
binding.messageQuote.quotedMessageAuthor.setTextColor(textColor)
|
||||||
binding.messageQuote.quotedMessage.setTextColor(textColor)
|
binding.messageQuote.quotedMessage.setTextColor(textColor)
|
||||||
|
@ -227,5 +226,6 @@ class OutcomingTextMessageViewHolder(itemView: View) : OutcomingTextMessageViewH
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val TEXT_SIZE_MULTIPLIER = 2.5
|
const val TEXT_SIZE_MULTIPLIER = 2.5
|
||||||
|
const val MAX_REPLY_LENGTH = 250
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue