Allow selection of any of contact's phone numbers

This commit is contained in:
Moez Bhatti
2018-01-12 22:59:45 -05:00
parent 050981faff
commit 634c7c707b
6 changed files with 159 additions and 48 deletions
@@ -44,11 +44,11 @@ open class ContactSync @Inject constructor(
.groupBy { contact -> contact.lookupKey }
.flatMap { group -> group.toList().toFlowable() }
.map { contacts ->
val numbers = contacts.map { it.numbers }.flatten()
val contact = contacts.first()
contact.numbers.clear()
contact.numbers.addAll(numbers)
contact
val allNumbers = contacts.map { it.numbers }.flatten()
contacts.first().apply {
numbers.clear()
numbers.addAll(allNumbers)
}
}
.toList().toFlowable()
.doOnNext { contacts ->