mirror of
https://github.com/SimpleMobileTools/Simple-Camera.git
synced 2025-01-27 21:49:19 +01:00
schedule autofocusing at app launch
This commit is contained in:
parent
64aec3cf4f
commit
97e72417fa
@ -172,6 +172,7 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan
|
||||
mSetupPreviewAfterMeasure = true
|
||||
requestLayout()
|
||||
invalidate()
|
||||
rescheduleAutofocus()
|
||||
}
|
||||
|
||||
private fun getSelectedResolution(): Camera.Size {
|
||||
@ -358,11 +359,8 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan
|
||||
|
||||
if (takePictureAfter) {
|
||||
takePicture()
|
||||
} else if (!mIsVideoMode || !mIsRecording) {
|
||||
autoFocusHandler.removeCallbacksAndMessages(null)
|
||||
autoFocusHandler.postDelayed({
|
||||
focusArea(false, false)
|
||||
}, REFOCUS_PERIOD)
|
||||
} else {
|
||||
rescheduleAutofocus()
|
||||
}
|
||||
}
|
||||
} catch (ignored: RuntimeException) {
|
||||
@ -385,6 +383,15 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan
|
||||
return Rect(rectLeft, rectTop, rectRight, rectBottom)
|
||||
}
|
||||
|
||||
private fun rescheduleAutofocus() {
|
||||
autoFocusHandler.removeCallbacksAndMessages(null)
|
||||
autoFocusHandler.postDelayed({
|
||||
if (!mIsVideoMode || !mIsRecording) {
|
||||
focusArea(false, false)
|
||||
}
|
||||
}, REFOCUS_PERIOD)
|
||||
}
|
||||
|
||||
fun showChangeResolutionDialog() {
|
||||
if (mCamera != null) {
|
||||
val oldResolution = getSelectedResolution()
|
||||
|
Loading…
x
Reference in New Issue
Block a user