mirror of
https://github.com/SimpleMobileTools/Simple-Camera.git
synced 2025-02-16 19:30:40 +01:00
show an Unknown error message if resolution selection failed
This commit is contained in:
parent
6f8b6c4b49
commit
f0fb06f111
@ -193,8 +193,9 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun getSelectedResolution(): Camera.Size {
|
private fun getSelectedResolution(): Camera.Size {
|
||||||
if (mParameters == null)
|
if (mParameters == null) {
|
||||||
mParameters = mCamera!!.parameters
|
mParameters = mCamera!!.parameters
|
||||||
|
}
|
||||||
|
|
||||||
var index = getResolutionIndex()
|
var index = getResolutionIndex()
|
||||||
val resolutions = if (mIsVideoMode) {
|
val resolutions = if (mIsVideoMode) {
|
||||||
@ -204,6 +205,7 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan
|
|||||||
}.sortedByDescending { it.width * it.height }
|
}.sortedByDescending { it.width * it.height }
|
||||||
|
|
||||||
if (index == -1) {
|
if (index == -1) {
|
||||||
|
mActivity?.toast(R.string.unknown_error_occurred)
|
||||||
index = getDefaultFullscreenResolution(resolutions) ?: 0
|
index = getDefaultFullscreenResolution(resolutions) ?: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user