From 93da3a9c6569ff8b3741e959294aa92b65c7916c Mon Sep 17 00:00:00 2001 From: rapterjet2004 Date: Tue, 23 May 2023 11:24:33 -0500 Subject: [PATCH] Making reply length a const Signed-off-by: Julius Linus Signed-off-by: Andy Scherzinger --- .../talk/adapters/messages/IncomingTextMessageViewHolder.kt | 4 ++-- .../talk/adapters/messages/OutcomingTextMessageViewHolder.kt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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 } }