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,
|
middleName = middleName,
|
||||||
surname = surname,
|
surname = surname,
|
||||||
photoUri = photoUri,
|
photoUri = photoUri,
|
||||||
phoneNumbers = phoneNumbers)
|
phoneNumbers = phoneNumbers).also {
|
||||||
// birthdays,
|
it.birthdays = birthdays
|
||||||
// anniversaries
|
it.anniversaries = anniversaries
|
||||||
|
}
|
||||||
|
|
||||||
contacts.add(contact)
|
contacts.add(contact)
|
||||||
} while (cursor.moveToNext())
|
} while (cursor.moveToNext())
|
||||||
|
|
|
@ -36,8 +36,8 @@ data class Contact(
|
||||||
) : Comparable<Contact> {
|
) : Comparable<Contact> {
|
||||||
val rawId = id
|
val rawId = id
|
||||||
val name = getNameToDisplay()
|
val name = getNameToDisplay()
|
||||||
val birthdays = events.filter { it.type == ContactsContract.CommonDataKinds.Event.TYPE_BIRTHDAY }.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>
|
||||||
val anniversaries = events.filter { it.type == ContactsContract.CommonDataKinds.Event.TYPE_ANNIVERSARY }.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 {
|
companion object {
|
||||||
var sorting = 0
|
var sorting = 0
|
||||||
|
|
Loading…
Reference in a new issue