mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-17 19:38:52 +01:00
Add ability to add contact from avatar
This commit is contained in:
@@ -25,6 +25,7 @@ import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.provider.ContactsContract
|
||||
import android.provider.Settings
|
||||
import android.provider.Telephony
|
||||
import common.util.NotificationManager
|
||||
@@ -89,6 +90,12 @@ class Navigator @Inject constructor(val context: Context) {
|
||||
startActivity(intent)
|
||||
}
|
||||
|
||||
fun addContact(address: String) {
|
||||
val uri = Uri.parse("tel: $address")
|
||||
val intent = Intent(ContactsContract.Intents.SHOW_OR_CREATE_CONTACT, uri)
|
||||
startActivity(intent)
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.O)
|
||||
fun showNotificationSettings() {
|
||||
val intent = Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS)
|
||||
|
||||
Reference in New Issue
Block a user