Files
Paperize/app/src/main/java/com/anthonyla/paperize/data/Contact.kt
T

26 lines
849 B
Kotlin
Raw Normal View History

2023-06-06 13:13:54 -07:00
package com.anthonyla.paperize.data
import android.content.Context
import android.content.Intent
import android.net.Uri
import androidx.compose.runtime.Composable
import androidx.core.content.ContextCompat.startActivity
2024-04-07 14:48:26 -07:00
/**
* Opens an email intent to contact the developer.
*/
@Composable
fun Contact(context: Context) {
val authorEmail = "anthonyyla.dev@gmail.com"
val cc = ""
2023-06-06 13:13:54 -07:00
val subject = "[Contact] Paperize - A Wallpaper Changer"
val bodyText = "This is regarding the Paperize app for Android:\n"
val mailto = "mailto:" + Uri.encode(authorEmail) +
"?cc=" + Uri.encode(cc) +
"&subject=" + Uri.encode(subject) +
"&body=" + Uri.encode(bodyText)
val emailIntent = Intent(Intent.ACTION_SENDTO)
emailIntent.setData(Uri.parse(mailto))
startActivity(context, emailIntent, null)
}