Skip to content

Commit

Permalink
Fixup of button click bug (#47)
Browse files Browse the repository at this point in the history
* *Changes onTouchListener to doOnTouchEvent if force dragging is disabled

* *revert
*fix of ignoreChildClickEvent
  • Loading branch information
Kumpello authored Sep 20, 2023
1 parent 457b782 commit 14b6fb6
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class FloatingBubble(
private fun customTouch() {

val dpi = getX()
val max_xy_move = dpi / 7
val max_xy_move = dpi / 22
// Log.d("<>", "dpi | xy: ${dpi} - ${max_xy_move}");
// Log.d("<>", "sdfasfasdf ${context.resources.configuration}: ");

Expand Down Expand Up @@ -215,10 +215,12 @@ class FloatingBubble(
ignoreClick = false
}

MotionEvent.ACTION_UP -> {
ignoreClick = false
}

MotionEvent.ACTION_MOVE -> {
if (abs(event.x) > max_xy_move || abs(event.y) > max_xy_move) {
ignoreClick = true
}
ignoreClick = abs(event.rawX - rawPointOnDown.x) > max_xy_move || abs(event.rawY - rawPointOnDown.y) > max_xy_move
}
}

Expand Down

0 comments on commit 14b6fb6

Please sign in to comment.