mirror of
https://github.com/SimpleMobileTools/Simple-Camera.git
synced 2025-06-27 09:02:59 +02:00
move the error with failed resolution setting to the moment of image capture
This commit is contained in:
@ -205,7 +205,6 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan
|
||||
}.sortedByDescending { it.width * it.height }
|
||||
|
||||
if (index == -1) {
|
||||
mActivity?.toast(R.string.setting_resolution_failed)
|
||||
index = getDefaultFullscreenResolution(resolutions) ?: 0
|
||||
}
|
||||
|
||||
@ -292,12 +291,15 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan
|
||||
if (mCanTakePicture) {
|
||||
val selectedResolution = getSelectedResolution()
|
||||
mParameters!!.setPictureSize(selectedResolution.width, selectedResolution.height)
|
||||
val pictureSize = mParameters!!.pictureSize
|
||||
if (selectedResolution.width != pictureSize.width || selectedResolution.height != pictureSize.height) {
|
||||
mActivity!!.toast(R.string.setting_resolution_failed)
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
|
||||
mCamera!!.enableShutterSound(false)
|
||||
}
|
||||
|
||||
|
||||
mRotationAtCapture = mActivity!!.mLastHandledOrientation
|
||||
updateCameraParameters()
|
||||
isWaitingForTakePictureCallback = true
|
||||
|
Reference in New Issue
Block a user