Skip to content

Commit

Permalink
Rely on custom keypad mappings for some characters
Browse files Browse the repository at this point in the history
Closes #139
  • Loading branch information
naveensingh committed Jan 13, 2025
1 parent 81add2c commit 8e804b6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.provider.Telephony.Sms.Intents.SECRET_CODE_ACTION
import android.telephony.PhoneNumberUtils
import android.telephony.TelephonyManager
import android.util.TypedValue
import android.view.KeyEvent
Expand Down Expand Up @@ -268,7 +267,7 @@ class DialpadActivity : SimpleActivity() {
(binding.dialpadList.adapter as? ContactsAdapter)?.finishActMode()

val filtered = allContacts.filter { contact ->
var convertedName = PhoneNumberUtils.convertKeypadLettersToDigits(
var convertedName = KeypadHelper.convertKeypadLettersToDigits(
contact.name.normalizeString()
).filterNot { it.isWhitespace() }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import android.content.Intent
import android.content.pm.ShortcutInfo
import android.graphics.drawable.Icon
import android.net.Uri
import android.telephony.PhoneNumberUtils
import android.text.TextUtils
import android.util.TypedValue
import android.view.*
Expand Down Expand Up @@ -377,7 +376,7 @@ class ContactsAdapter(
} else {
var spacedTextToHighlight = textToHighlight
val strippedName = name.filterNot { it.isWhitespace() }
val strippedDigits = PhoneNumberUtils.convertKeypadLettersToDigits(strippedName)
val strippedDigits = KeypadHelper.convertKeypadLettersToDigits(strippedName)
val startIndex = strippedDigits.indexOf(textToHighlight)

if (strippedDigits.contains(textToHighlight)) {
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ detekt = "1.23.3"
#Eventbus
eventbus = "3.3.1"
#Fossify
commons = "30b338e429"
commons = "4f91781981"
#Gradle
gradlePlugins-agp = "8.7.3"
#Other
Expand Down

0 comments on commit 8e804b6

Please sign in to comment.