Add vCard attachment preview
This commit is contained in:
parent
d874e16024
commit
f07abeb54c
58 changed files with 1263 additions and 117 deletions
|
|
@ -28,6 +28,7 @@ const val EXPORT_FILE_EXT = ".json"
|
|||
const val IMPORT_SMS = "import_sms"
|
||||
const val IMPORT_MMS = "import_mms"
|
||||
const val WAS_DB_CLEARED = "was_db_cleared_2"
|
||||
const val EXTRA_VCARD_URI = "vcard"
|
||||
|
||||
private const val PATH = "com.simplemobiletools.smsmessenger.action."
|
||||
const val MARK_AS_READ = PATH + "mark_as_read"
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue