From af72725ad789479d41ef119de250b87f07af9ac0 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 21 Mar 2017 23:05:23 +0100 Subject: [PATCH] close the resolution picker dialog after changing a resolution --- .../camera/dialogs/ChangeResolutionDialog.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/camera/dialogs/ChangeResolutionDialog.kt b/app/src/main/kotlin/com/simplemobiletools/camera/dialogs/ChangeResolutionDialog.kt index e0996428..2147b8ff 100644 --- a/app/src/main/kotlin/com/simplemobiletools/camera/dialogs/ChangeResolutionDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/camera/dialogs/ChangeResolutionDialog.kt @@ -13,13 +13,15 @@ import com.simplemobiletools.commons.models.RadioItem import kotlinx.android.synthetic.main.dialog_change_resolution.view.* class ChangeResolutionDialog(val activity: SimpleActivity, val isBackCamera: Boolean, val camera: Camera, val callback: () -> Unit) { + var dialog: AlertDialog + init { val view = LayoutInflater.from(activity).inflate(R.layout.dialog_change_resolution, null).apply { setupPhotoResolutionPicker(this) setupVideoResolutionPicker(this) } - AlertDialog.Builder(activity) + dialog = AlertDialog.Builder(activity) .setPositiveButton(R.string.ok, null) .setOnDismissListener { callback() } .create().apply { @@ -39,6 +41,7 @@ class ChangeResolutionDialog(val activity: SimpleActivity, val isBackCamera: Boo config.backPhotoResIndex = it else config.frontPhotoResIndex = it + dialog.dismiss() } } view.change_resolution_photo.text = items[selectionIndex].title @@ -56,6 +59,7 @@ class ChangeResolutionDialog(val activity: SimpleActivity, val isBackCamera: Boo config.backVideoResIndex = it else config.frontVideoResIndex = it + dialog.dismiss() } } view.change_resolution_video.text = items[selectionIndex].title