ContactItem improvements (#1324)

* ContactRepository: try to deduplicate phoneNumbers in a smart way

* AndroidManifest: use CALL_PHONE permission to allow for making phone calls

* Implement CallOnTap with contact results

- contact activities that require permissions we do not have are not
  listed
- add CallOnTap setting for phone number results on search behind
  contacts settings

* utilize PhoneNumberUtils

* navroute settings/search/contacts

* queryIntentActivities -> resolveActivity

* localization

* Code formatting

* Wrap contact search settings in preference category

---------

Co-authored-by: MM20 <15646950+MM2-0@users.noreply.github.com>
This commit is contained in:
Christoph
2025-03-29 17:18:30 +01:00
committed by GitHub
co-authored by MM20
parent 21894d8df2
commit bceae1aa58
14 changed files with 191 additions and 10 deletions
@@ -15,3 +15,15 @@ fun <T> List<T>.randomElementOrNull(): T? {
fun <T> List<T>?.ifNullOrEmpty(block: () -> List<T>): List<T> {
return if (this.isNullOrEmpty()) block() else this
}
fun <T> List<T>.distinctByEquality(equalityPredicate: (T, T) -> Boolean): List<T> {
if (size < 2) return this
val ret = mutableListOf<T>()
for (item in this) {
if (ret.none { equalityPredicate(it, item) }) ret.add(item)
}
return ret
}