From 3f9a378e7efc2e562c3a9f9412c4e01aa88a927c Mon Sep 17 00:00:00 2001 From: Naveen Date: Wed, 31 Aug 2022 23:26:59 +0530 Subject: [PATCH] Export formatted name in vcf --- .../simplemobiletools/contacts/pro/helpers/VcfExporter.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/VcfExporter.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/VcfExporter.kt index 127e34f2..432c06a1 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/VcfExporter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/VcfExporter.kt @@ -51,6 +51,12 @@ class VcfExporter { val cards = ArrayList() 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