Add vCard attachment preview

This commit is contained in:
Naveen 2022-08-29 03:19:50 +05:30
parent d874e16024
commit f07abeb54c
58 changed files with 1263 additions and 117 deletions

View file

@ -0,0 +1,15 @@
package com.simplemobiletools.smsmessenger.helpers
import android.content.Context
import android.net.Uri
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
import ezvcard.Ezvcard
import ezvcard.VCard
fun parseVCardFromUri(context: Context, uri: Uri, callback: (vCards: List<VCard>) -> Unit) {
ensureBackgroundThread {
val inputStream = context.contentResolver.openInputStream(uri)
val vCards = Ezvcard.parse(inputStream).all()
callback(vCards)
}
}