mirror of
https://github.com/SimpleMobileTools/Simple-Camera.git
synced 2025-02-17 03:40:38 +01:00
fix a crash at getting -1th element of an array
This commit is contained in:
parent
4d60ba741d
commit
baf6c36bcd
@ -33,6 +33,7 @@ class ChangeResolutionDialog(val activity: SimpleActivity, val isBackCamera: Boo
|
|||||||
private fun setupPhotoResolutionPicker(view: View) {
|
private fun setupPhotoResolutionPicker(view: View) {
|
||||||
val items = getFormattedResolutions(camera.parameters.supportedPictureSizes)
|
val items = getFormattedResolutions(camera.parameters.supportedPictureSizes)
|
||||||
var selectionIndex = if (isBackCamera) config.backPhotoResIndex else config.frontPhotoResIndex
|
var selectionIndex = if (isBackCamera) config.backPhotoResIndex else config.frontPhotoResIndex
|
||||||
|
selectionIndex = Math.max(selectionIndex, 0)
|
||||||
|
|
||||||
view.change_resolution_photo_holder.setOnClickListener {
|
view.change_resolution_photo_holder.setOnClickListener {
|
||||||
RadioGroupDialog(activity, items, selectionIndex) {
|
RadioGroupDialog(activity, items, selectionIndex) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user