update mLastClickX and Y only at Down action

This commit is contained in:
tibbi 2018-05-30 21:26:16 +02:00
parent 7ffe53a0ae
commit 328c4300a5
1 changed files with 5 additions and 2 deletions

View File

@ -13,6 +13,7 @@ import android.os.Build
import android.os.Handler import android.os.Handler
import android.os.HandlerThread import android.os.HandlerThread
import android.util.Size import android.util.Size
import android.view.MotionEvent
import android.view.Surface import android.view.Surface
import android.view.TextureView import android.view.TextureView
import android.view.ViewGroup import android.view.ViewGroup
@ -63,8 +64,10 @@ class PreviewCameraTwo : ViewGroup, TextureView.SurfaceTextureListener, MyPrevie
mTextureView = textureView mTextureView = textureView
mTextureView.setOnTouchListener { view, event -> mTextureView.setOnTouchListener { view, event ->
if (event.action == MotionEvent.ACTION_DOWN) {
mLastClickX = event.x mLastClickX = event.x
mLastClickY = event.y mLastClickY = event.y
}
false false
} }