focus the middle of the screen if no other place was clicked
This commit is contained in:
parent
5115739a96
commit
69beac2f55
|
@ -322,8 +322,12 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan
|
||||||
return
|
return
|
||||||
|
|
||||||
mCamera!!.cancelAutoFocus()
|
mCamera!!.cancelAutoFocus()
|
||||||
val focusRect = calculateFocusArea(mLastClickX.toFloat(), mLastClickY.toFloat())
|
|
||||||
if (mParameters!!.maxNumFocusAreas > 0) {
|
if (mParameters!!.maxNumFocusAreas > 0) {
|
||||||
|
if (mLastClickX == 0 && mLastClickY == 0) {
|
||||||
|
mLastClickX = width / 2
|
||||||
|
mLastClickY = height / 2
|
||||||
|
}
|
||||||
|
val focusRect = calculateFocusArea(mLastClickX.toFloat(), mLastClickY.toFloat())
|
||||||
val focusAreas = ArrayList<Camera.Area>(1)
|
val focusAreas = ArrayList<Camera.Area>(1)
|
||||||
focusAreas.add(Camera.Area(focusRect, 1000))
|
focusAreas.add(Camera.Area(focusRect, 1000))
|
||||||
mParameters!!.focusAreas = focusAreas
|
mParameters!!.focusAreas = focusAreas
|
||||||
|
|
Loading…
Reference in New Issue