use the contacts name at sharing, if we share only one

This commit is contained in:
tibbi
2021-03-04 23:17:25 +01:00
parent 68082ab9ed
commit 8511cfd25a
4 changed files with 11 additions and 4 deletions

View File

@ -80,7 +80,13 @@ fun SimpleActivity.showContactSourcePicker(currentSource: String, callback: (new
}
fun BaseSimpleActivity.shareContacts(contacts: ArrayList<Contact>) {
val file = getTempFile()
val filename = if (contacts.size == 1) {
"${contacts.first().getNameToDisplay()}.vcf"
} else {
DEFAULT_FILE_NAME
}
val file = getTempFile(filename)
if (file == null) {
toast(R.string.unknown_error_occurred)
return