Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Screen sensitivity across Android devices

I have encountered a really weird scenario during my tests and maybe you can light me.

Scenario: The application consists in a Surfaceview in which I handle the touch event. I have a image on the screen and the user put's his finger on it and then takes it back. Just like a short button pressing.

What goes wrong:

Samsung Galaxy S with SuperAmoled screen - the touch events fired are: Down and then Up. just like it is normally

Nexus One, Desire - the touch events fired are: Down, Move, Move, Up The move gesture is small like +- 1 px but there is. Now imagine the fact that I have code that is fired in Move event.

So testing on my Galaxy S everything works wonderful, testing on Nexus it fails as it doesn't react as supposed to.

My Questions:

  • is there any way to prevent this ?
  • is this because of screen type and sensitivity ?
like image 947
Alin Avatar asked Nov 27 '25 07:11

Alin


1 Answers

Use boolean flag to prevent code to run in Move Event by setting flag to true in down event and then call the methods.

like image 94
Shachillies Avatar answered Nov 29 '25 20:11

Shachillies



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!