Skip to content

Commit 14b6fb6

Browse files
authored
Fixup of button click bug (#47)
* *Changes onTouchListener to doOnTouchEvent if force dragging is disabled * *revert *fix of ignoreChildClickEvent
1 parent 457b782 commit 14b6fb6

File tree

1 file changed

+6
-4
lines changed
  • FloatingBubbleView/src/main/java/com/torrydo/floatingbubbleview/bubble

1 file changed

+6
-4
lines changed

FloatingBubbleView/src/main/java/com/torrydo/floatingbubbleview/bubble/FloatingBubble.kt

+6-4
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ class FloatingBubble(
176176
private fun customTouch() {
177177

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

@@ -215,10 +215,12 @@ class FloatingBubble(
215215
ignoreClick = false
216216
}
217217

218+
MotionEvent.ACTION_UP -> {
219+
ignoreClick = false
220+
}
221+
218222
MotionEvent.ACTION_MOVE -> {
219-
if (abs(event.x) > max_xy_move || abs(event.y) > max_xy_move) {
220-
ignoreClick = true
221-
}
223+
ignoreClick = abs(event.rawX - rawPointOnDown.x) > max_xy_move || abs(event.rawY - rawPointOnDown.y) > max_xy_move
222224
}
223225
}
224226

0 commit comments

Comments
 (0)