mirror of
https://github.com/SimpleMobileTools/Simple-Dialer.git
synced 2025-04-08 15:31:24 +02:00
properly handle default contact numbers at calling
This commit is contained in:
parent
8c4a78e298
commit
ef4653512a
@ -61,6 +61,6 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'com.github.SimpleMobileTools:Simple-Commons:b45fde5669'
|
implementation 'com.github.SimpleMobileTools:Simple-Commons:fd1fde1dbd'
|
||||||
implementation 'com.github.tibbi:IndicatorFastScroll:4524cd0b61'
|
implementation 'com.github.tibbi:IndicatorFastScroll:4524cd0b61'
|
||||||
}
|
}
|
||||||
|
@ -143,6 +143,10 @@ class FavoritesFragment(context: Context, attributeSet: AttributeSet) : MyViewPa
|
|||||||
val phoneNumbers = simpleContact.phoneNumbers
|
val phoneNumbers = simpleContact.phoneNumbers
|
||||||
if (phoneNumbers.size <= 1) {
|
if (phoneNumbers.size <= 1) {
|
||||||
activity?.launchCallIntent(phoneNumbers.first().normalizedNumber)
|
activity?.launchCallIntent(phoneNumbers.first().normalizedNumber)
|
||||||
|
} else {
|
||||||
|
val primaryNumber = simpleContact.phoneNumbers.find { it.isPrimary }
|
||||||
|
if (primaryNumber != null) {
|
||||||
|
activity?.launchCallIntent(primaryNumber.value)
|
||||||
} else {
|
} else {
|
||||||
val items = ArrayList<RadioItem>()
|
val items = ArrayList<RadioItem>()
|
||||||
phoneNumbers.forEachIndexed { index, phoneNumber ->
|
phoneNumbers.forEachIndexed { index, phoneNumber ->
|
||||||
@ -155,6 +159,7 @@ class FavoritesFragment(context: Context, attributeSet: AttributeSet) : MyViewPa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun setupLetterFastscroller(contacts: ArrayList<SimpleContact>) {
|
private fun setupLetterFastscroller(contacts: ArrayList<SimpleContact>) {
|
||||||
letter_fastscroller.setupWithRecyclerView(fragment_list, { position ->
|
letter_fastscroller.setupWithRecyclerView(fragment_list, { position ->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user