mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-03-03 18:47:52 +01:00
fix #534, show all contacts at the Dialpad screen by default
This commit is contained in:
parent
8a41f3022f
commit
8f8b5800b8
@ -104,11 +104,14 @@ class DialpadActivity : SimpleActivity() {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun checkDialIntent() {
|
private fun checkDialIntent(): Boolean {
|
||||||
if (intent.action == Intent.ACTION_DIAL && intent.data != null && intent.dataString?.contains("tel:") == true) {
|
return if (intent.action == Intent.ACTION_DIAL && intent.data != null && intent.dataString?.contains("tel:") == true) {
|
||||||
val number = Uri.decode(intent.dataString).substringAfter("tel:")
|
val number = Uri.decode(intent.dataString).substringAfter("tel:")
|
||||||
dialpad_input.setText(number)
|
dialpad_input.setText(number)
|
||||||
dialpad_input.setSelection(number.length)
|
dialpad_input.setSelection(number.length)
|
||||||
|
true
|
||||||
|
} else {
|
||||||
|
false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -163,7 +166,9 @@ class DialpadActivity : SimpleActivity() {
|
|||||||
|
|
||||||
private fun gotContacts(newContacts: ArrayList<Contact>) {
|
private fun gotContacts(newContacts: ArrayList<Contact>) {
|
||||||
contacts = newContacts
|
contacts = newContacts
|
||||||
checkDialIntent()
|
if (!checkDialIntent() && dialpad_input.value.isEmpty()) {
|
||||||
|
dialpadValueChanged("")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@TargetApi(Build.VERSION_CODES.O)
|
@TargetApi(Build.VERSION_CODES.O)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user