diff --git a/common/src/main/java/dev/lucasnlm/antimine/common/level/view/AreaAdapter.kt b/common/src/main/java/dev/lucasnlm/antimine/common/level/view/AreaAdapter.kt index d131bb81..825b93eb 100644 --- a/common/src/main/java/dev/lucasnlm/antimine/common/level/view/AreaAdapter.kt +++ b/common/src/main/java/dev/lucasnlm/antimine/common/level/view/AreaAdapter.kt @@ -110,6 +110,13 @@ class AreaAdapter( var longClickJob: Job? = null view.setOnTouchListener { _, motionEvent -> when (motionEvent.action) { + MotionEvent.ACTION_MOVE -> { + longClickJob?.let { job -> + job.cancel() + longClickJob = null + } + true + } MotionEvent.ACTION_DOWN -> { view.isPressed = true longClickJob = coroutineScope.launch { @@ -164,6 +171,11 @@ class AreaAdapter( } } } + } else { + longClickJob?.let { job -> + job.cancel() + longClickJob = null + } } handled }