move the error with failed resolution setting to the moment of image capture
This commit is contained in:
parent
59da992442
commit
d04ed7d334
|
@ -84,6 +84,7 @@ class PhotoProcessor(val activity: MainActivity, val uri: Uri?, val currCameraId
|
|||
} else {
|
||||
matrix.preScale(-1f, 1f)
|
||||
}
|
||||
|
||||
try {
|
||||
image = Bitmap.createBitmap(image, 0, 0, image.width, image.height, matrix, false)
|
||||
} catch (e: OutOfMemoryError) {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue