fix detekt

Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
sowjanyakch 2025-02-21 14:56:58 +01:00 committed by Marcel Hibbe
parent 24fdf0884e
commit 4abb28e445
No known key found for this signature in database
GPG Key ID: C793F8B59F43CE7B
2 changed files with 7 additions and 4 deletions

View File

@ -84,12 +84,15 @@ class IncomingTextMessageViewHolder(itemView: View, payload: Any) :
itemView.isSelected = false
val user = currentUserProvider.currentUser.blockingGet()
var textSize = context.resources!!.getDimension(R.dimen.chat_text_size)
val hasCheckboxes = processCheckboxes(
message,
user
)
processMessage(message, hasCheckboxes)
}
private fun processMessage(message: ChatMessage, hasCheckboxes: Boolean) {
var textSize = context.resources!!.getDimension(R.dimen.chat_text_size)
if (!hasCheckboxes) {
var processedMessageText = messageUtils.enrichChatMessageText(
binding.messageText.context,
@ -227,7 +230,7 @@ class IncomingTextMessageViewHolder(itemView: View, payload: Any) :
checkboxes.forEach { checkBox ->
updatedMessage = regex.replace(updatedMessage) { matchResult ->
val taskText = matchResult.groupValues[3].trim()
val taskText = matchResult.groupValues[TASK_TEXT_GROUP_INDEX].trim()
val checkboxState = if (checkboxes.find { it.text == taskText }?.isChecked == true) "X" else " "
"- [$checkboxState] $taskText"
}

View File

@ -588,7 +588,7 @@ How to translate with transifex:
<string name="nc_phone_book_integration_chat_via">Chat via %s</string>
<string name="nc_phone_book_integration_account_not_found">Account not found</string>
<string name= "nc_edit">Edit</string>
<string name="edited_by">(edited by %1$s)</string>
<!-- save feature -->
<string name="nc_save_message">Save</string>
<string name="nc_dialog_save_to_storage_title">Save to storage?</string>