Export formatted name in vcf

This commit is contained in:
Naveen 2022-08-31 23:26:59 +05:30
parent 293522d4b1
commit 3f9a378e7e
1 changed files with 6 additions and 0 deletions

View File

@ -51,6 +51,12 @@ class VcfExporter {
val cards = ArrayList<VCard>()
for (contact in contacts) {
val card = VCard()
val formattedName = arrayOf(contact.prefix, contact.firstName, contact.middleName, contact.surname, contact.suffix)
.filter { it.isNotEmpty() }
.joinToString(separator = " ")
card.formattedName = FormattedName(formattedName)
StructuredName().apply {
prefixes.add(contact.prefix)
given = contact.firstName