TorryDo / Floating-Bubble-View

πŸ€an Android library that adds floating views on top of your screen🎨, supports both XML and Jetpack Compose
Apache License 2.0
204 stars 34 forks source link

`onUp()` callback is not called if the bubble is quickly released #29

Closed moazelsawaf closed 1 year ago

moazelsawaf commented 1 year ago

Hello @TorryDo ❀

I was implementing some logic in the FloatingBubbleListener callbacks but I have observed a behavior which I wanted to ask about.

When I tap on the bubble, the onDown() callback is called instantly as intended, but if I released my finger quickly from the bubble, the onClick() callback would be fired while onUp() is not.

If I tapped on the bubble and waited for a very short time (~1 sec), then the onDown() callback would be called without any issues as in the past case, but the onUp() callback would be called while onClick() not.

Here is the output for both scenarios for logging a statement in each mentioned callbacks:

First Scenario:

Bubble Tapped Down on: 99.0, 358.0
Bubble Clicked

Second Scenario:

Bubble Tapped Down on: 120.0, 332.0
Bubble Tapped Up on: 120.0, 332.0

So is it an intended behavior or it is a bug? πŸ€”

Thanks in advance ❀

TorryDo commented 1 year ago

Based on the behavior you described, it seems to be a bug.

The onClick() callback should be triggered in correspondence with the onUp() method, unless the user has moved their finger before releasing the bubble. I'll look into it further.

Thank you! πŸ’–

TorryDo commented 1 year ago

The issue is now gone in v0.5.2

If you have any further concerns, don't hesitate to reopen the issue.

Cheers 🍺🍻

moazelsawaf commented 1 year ago

I have tested the issue against v0.5.2 and it is solved πŸ’ͺ🏻

Thank you so much πŸ™πŸ»β€