mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-04-27 15:58:41 +02: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")
|
putExtra("scaleUpIfNeeded", "true")
|
||||||
clipData = ClipData("Attachment", arrayOf("text/uri-list"), ClipData.Item(lastPhotoIntentUri))
|
clipData = ClipData("Attachment", arrayOf("text/uri-list"), ClipData.Item(lastPhotoIntentUri))
|
||||||
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION or Intent.FLAG_GRANT_WRITE_URI_PERMISSION)
|
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION or Intent.FLAG_GRANT_WRITE_URI_PERMISSION)
|
||||||
|
if (resolveActivity(packageManager) != null) {
|
||||||
startActivityForResult(this, INTENT_CROP_PHOTO)
|
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 {
|
.create().apply {
|
||||||
activity.setupDialogStuff(view, this, R.string.export_contacts) {
|
activity.setupDialogStuff(view, this, R.string.export_contacts) {
|
||||||
getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener {
|
getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener {
|
||||||
|
if (view.export_contacts_list.adapter == null) {
|
||||||
|
return@setOnClickListener
|
||||||
|
}
|
||||||
|
|
||||||
val filename = view.export_contacts_filename.value
|
val filename = view.export_contacts_filename.value
|
||||||
when {
|
when {
|
||||||
filename.isEmpty() -> activity.toast(R.string.empty_name)
|
filename.isEmpty() -> activity.toast(R.string.empty_name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user