stanipintjuk / Silverfish

A simple and lightweight launcher for Android.
GNU General Public License v3.0
44 stars 17 forks source link

Fixed #3 (long click bug when swipping) #8

Closed Lonami closed 8 years ago

stanipintjuk commented 8 years ago

Hmmm, when keeping the MOVE_THRESHOLD at 40 it doesn't have an effect. The widget replacement is still triggered when swiping.

When I changed it to 10 then the swiping on widget works great, but I can't long click and change the widget anymore.

Lonami commented 8 years ago

It's weird, there was once when I logged the distance my finger didn't move and it said 0, so it should work with 10. What other possible a workarounds do we have?

Lonami commented 8 years ago

Should we instead check for movement every time the onTouch event is called? And if at any given moment the distance is greater than the threshold, when we need to check we simply don't fire it. It would cost some more calculations than only one at the end, but perhaps it works.

stanipintjuk commented 8 years ago

I think that I fixed it. Apparently all we had to do was listen for the MotionEvent.ACTION_MOVE and cancel the long click at that point.

Lonami commented 8 years ago

Awesome, so MOVE_THRESHOLD became infinitely small @stanipintjuk? ;)

stanipintjuk commented 8 years ago

int MOVE_THRESHOLD = { 0 | 1, 1/2, 1/4, 1/8, … } ;)