fix: added birthdays and anniversaries to provided contact content.
This commit is contained in:
parent
7960a721dc
commit
7bff8457b2
2 changed files with 6 additions and 5 deletions
|
@ -93,9 +93,10 @@ class MyContactsContentProvider {
|
|||
middleName = middleName,
|
||||
surname = surname,
|
||||
photoUri = photoUri,
|
||||
phoneNumbers = phoneNumbers)
|
||||
// birthdays,
|
||||
// anniversaries
|
||||
phoneNumbers = phoneNumbers).also {
|
||||
it.birthdays = birthdays
|
||||
it.anniversaries = anniversaries
|
||||
}
|
||||
|
||||
contacts.add(contact)
|
||||
} while (cursor.moveToNext())
|
||||
|
|
|
@ -36,8 +36,8 @@ data class Contact(
|
|||
) : Comparable<Contact> {
|
||||
val rawId = id
|
||||
val name = getNameToDisplay()
|
||||
val birthdays = events.filter { it.type == ContactsContract.CommonDataKinds.Event.TYPE_BIRTHDAY }.map { it.value }.toMutableList() as ArrayList<String>
|
||||
val anniversaries = events.filter { it.type == ContactsContract.CommonDataKinds.Event.TYPE_ANNIVERSARY }.map { it.value }.toMutableList() as ArrayList<String>
|
||||
var birthdays = events.filter { it.type == ContactsContract.CommonDataKinds.Event.TYPE_BIRTHDAY }.map { it.value }.toMutableList() as ArrayList<String>
|
||||
var anniversaries = events.filter { it.type == ContactsContract.CommonDataKinds.Event.TYPE_ANNIVERSARY }.map { it.value }.toMutableList() as ArrayList<String>
|
||||
|
||||
companion object {
|
||||
var sorting = 0
|
||||
|
|
Loading…
Reference in a new issue