From 869b5aa3d5517c7131c1ae233b2ade36e612d406 Mon Sep 17 00:00:00 2001 From: Abdullah Emad Date: Sat, 1 Feb 2025 22:13:52 +0100 Subject: [PATCH] Highlight all the message search matches. It is expected that when a user search for a message, that all the matches within the same messages are highlighted (if there are more than one match) not just the first match. This is also consistent with how the search in the desktop app is implemented. Resolves #13960 --- .../v2/items/V2ConversationItemTextOnlyViewHolder.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/items/V2ConversationItemTextOnlyViewHolder.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/items/V2ConversationItemTextOnlyViewHolder.kt index ca309b2c7e..2df6fd5248 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/items/V2ConversationItemTextOnlyViewHolder.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/items/V2ConversationItemTextOnlyViewHolder.kt @@ -414,7 +414,7 @@ open class V2ConversationItemTextOnlyViewHolder>( linkifyMessageBody(styledText) } - styledText = SearchUtil.getHighlightedSpan(Locale.getDefault(), STYLE_FACTORY, styledText, conversationContext.searchQuery, SearchUtil.STRICT) + styledText = SearchUtil.getHighlightedSpan(Locale.getDefault(), STYLE_FACTORY, styledText, conversationContext.searchQuery, SearchUtil.MATCH_ALL) if (record.hasExtraText()) { binding.body.setOverflowText(getLongMessageSpan()) } else {