mirror of
https://github.com/FossifyOrg/Phone.git
synced 2026-05-18 21:55:11 -04:00
fixes #139
This commit is contained in:
@@ -369,7 +369,19 @@ class ContactsAdapter(
|
||||
if (name.contains(textToHighlight, true)) {
|
||||
name.highlightTextPart(textToHighlight, properPrimaryColor)
|
||||
} else {
|
||||
name.highlightTextFromNumbers(textToHighlight.replace('1', ' '), properPrimaryColor)
|
||||
var spacedTextToHighlight = textToHighlight
|
||||
val strippedName = PhoneNumberUtils.convertKeypadLettersToDigits(name.filterNot { it.isWhitespace() })
|
||||
val startIndex = strippedName.indexOf(textToHighlight)
|
||||
|
||||
if ( strippedName.contains(textToHighlight)) {
|
||||
for (i in 0..spacedTextToHighlight.length) {
|
||||
if (name[startIndex+i].isWhitespace()) {
|
||||
spacedTextToHighlight = spacedTextToHighlight.replaceRange(i, i, " ")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
name.highlightTextFromNumbers(spacedTextToHighlight, properPrimaryColor)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user