diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingTextMessageViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingTextMessageViewHolder.kt index 413cdcf20..33dcf4f37 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingTextMessageViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingTextMessageViewHolder.kt @@ -171,7 +171,6 @@ class IncomingTextMessageViewHolder(itemView: View, payload: Any) : } private fun processParentMessage(message: ChatMessage) { - val maxReplyLength = 250 val parentChatMessage = message.parentMessage parentChatMessage!!.activeUser = message.activeUser parentChatMessage.imageUrl?.let { @@ -190,7 +189,7 @@ class IncomingTextMessageViewHolder(itemView: View, payload: Any) : } else { 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) { viewThemeUtils.platform.colorViewBackground(binding.messageQuote.quoteColoredView) @@ -263,5 +262,6 @@ class IncomingTextMessageViewHolder(itemView: View, payload: Any) : companion object { const val TEXT_SIZE_MULTIPLIER = 2.5 + const val MAX_REPLY_LENGTH = 250 } } diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingTextMessageViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingTextMessageViewHolder.kt index 6e6ca9783..66021b181 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingTextMessageViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingTextMessageViewHolder.kt @@ -148,7 +148,6 @@ class OutcomingTextMessageViewHolder(itemView: View) : OutcomingTextMessageViewH } private fun processParentMessage(message: ChatMessage) { - val maxReplyLength = 250 val parentChatMessage = message.parentMessage val textColor = viewThemeUtils.getScheme(binding.messageQuote.quotedMessage.context).onSurfaceVariant parentChatMessage!!.activeUser = message.activeUser @@ -165,7 +164,7 @@ class OutcomingTextMessageViewHolder(itemView: View) : OutcomingTextMessageViewH } binding.messageQuote.quotedMessageAuthor.text = parentChatMessage.actorDisplayName ?: 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.quotedMessage.setTextColor(textColor) @@ -227,5 +226,6 @@ class OutcomingTextMessageViewHolder(itemView: View) : OutcomingTextMessageViewH companion object { const val TEXT_SIZE_MULTIPLIER = 2.5 + const val MAX_REPLY_LENGTH = 250 } }