Add vCard attachment preview
This commit is contained in:
parent
d874e16024
commit
f07abeb54c
58 changed files with 1263 additions and 117 deletions
|
|
@ -24,3 +24,19 @@ fun Activity.dialNumber(phoneNumber: String, callback: (() -> Unit)? = null) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun Activity.sendMail(email: String) {
|
||||
hideKeyboard()
|
||||
Intent(Intent.ACTION_SENDTO).apply {
|
||||
data = Uri.parse("mailto:")
|
||||
putExtra(Intent.EXTRA_EMAIL, email)
|
||||
|
||||
try {
|
||||
startActivity(this)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
toast(R.string.no_app_found)
|
||||
} catch (e: Exception) {
|
||||
showErrorToast(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
package com.simplemobiletools.smsmessenger.extensions
|
||||
|
||||
import android.text.format.DateFormat
|
||||
import java.util.*
|
||||
|
||||
fun Date.format(pattern: String): String {
|
||||
return DateFormat.format(pattern, this).toString()
|
||||
}
|
||||
|
|
@ -14,3 +14,8 @@ fun String.getExtensionFromMimeType(): String {
|
|||
fun String.isImageMimeType(): Boolean {
|
||||
return lowercase().startsWith("image")
|
||||
}
|
||||
|
||||
fun String.isVCardMimeType(): Boolean {
|
||||
val lowercase = lowercase()
|
||||
return lowercase.endsWith("x-vcard") || lowercase.endsWith("vcard")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue