mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-02-09 08:08:49 +01:00
check if there is an available app for Crop before launching it
This commit is contained in:
parent
8dd3dd08cd
commit
bcdd8fe40f
@ -204,7 +204,11 @@ class EditContactActivity : ContactActivity() {
|
||||
putExtra("scaleUpIfNeeded", "true")
|
||||
clipData = ClipData("Attachment", arrayOf("text/uri-list"), ClipData.Item(lastPhotoIntentUri))
|
||||
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION or Intent.FLAG_GRANT_WRITE_URI_PERMISSION)
|
||||
startActivityForResult(this, INTENT_CROP_PHOTO)
|
||||
if (resolveActivity(packageManager) != null) {
|
||||
startActivityForResult(this, INTENT_CROP_PHOTO)
|
||||
} else {
|
||||
toast(R.string.no_app_found)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,6 +36,10 @@ class ExportContactsDialog(val activity: SimpleActivity, val path: String, priva
|
||||
.create().apply {
|
||||
activity.setupDialogStuff(view, this, R.string.export_contacts) {
|
||||
getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener {
|
||||
if (view.export_contacts_list.adapter == null) {
|
||||
return@setOnClickListener
|
||||
}
|
||||
|
||||
val filename = view.export_contacts_filename.value
|
||||
when {
|
||||
filename.isEmpty() -> activity.toast(R.string.empty_name)
|
||||
|
Loading…
x
Reference in New Issue
Block a user