From 4e3d8ae9ac97a51c048060a1a395031814073cfe Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 5 May 2017 11:15:34 +0200 Subject: [PATCH] use the activity config at showing resolution picker --- .../camera/dialogs/ChangeResolutionDialog.kt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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 46918ac8..e1569cfb 100644 --- a/app/src/main/kotlin/com/simplemobiletools/camera/dialogs/ChangeResolutionDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/camera/dialogs/ChangeResolutionDialog.kt @@ -4,9 +4,9 @@ import android.hardware.Camera import android.support.v7.app.AlertDialog import android.view.LayoutInflater import android.view.View -import com.simplemobiletools.camera.Preview.Companion.config import com.simplemobiletools.camera.R import com.simplemobiletools.camera.activities.SimpleActivity +import com.simplemobiletools.camera.extensions.config import com.simplemobiletools.camera.extensions.getAspectRatio import com.simplemobiletools.commons.dialogs.RadioGroupDialog import com.simplemobiletools.commons.extensions.setupDialogStuff @@ -32,7 +32,7 @@ class ChangeResolutionDialog(val activity: SimpleActivity, val isBackCamera: Boo private fun setupPhotoResolutionPicker(view: View) { val items = getFormattedResolutions(camera.parameters.supportedPictureSizes) - var selectionIndex = if (isBackCamera) config.backPhotoResIndex else config.frontPhotoResIndex + var selectionIndex = if (isBackCamera) activity.config.backPhotoResIndex else activity.config.frontPhotoResIndex selectionIndex = Math.max(selectionIndex, 0) view.change_resolution_photo_holder.setOnClickListener { @@ -40,9 +40,9 @@ class ChangeResolutionDialog(val activity: SimpleActivity, val isBackCamera: Boo selectionIndex = it as Int view.change_resolution_photo.text = items[selectionIndex].title if (isBackCamera) - config.backPhotoResIndex = it + activity.config.backPhotoResIndex = it else - config.frontPhotoResIndex = it + activity.config.frontPhotoResIndex = it dialog.dismiss() } } @@ -51,16 +51,16 @@ class ChangeResolutionDialog(val activity: SimpleActivity, val isBackCamera: Boo private fun setupVideoResolutionPicker(view: View) { val items = getFormattedResolutions(camera.parameters.supportedVideoSizes ?: camera.parameters.supportedPreviewSizes) - var selectionIndex = if (isBackCamera) config.backVideoResIndex else config.frontVideoResIndex + var selectionIndex = if (isBackCamera) activity.config.backVideoResIndex else activity.config.frontVideoResIndex view.change_resolution_video_holder.setOnClickListener { RadioGroupDialog(activity, items, selectionIndex) { selectionIndex = it as Int view.change_resolution_video.text = items[selectionIndex].title if (isBackCamera) - config.backVideoResIndex = it + activity.config.backVideoResIndex = it else - config.frontVideoResIndex = it + activity.config.frontVideoResIndex = it dialog.dismiss() } }