开发者

Screen sensitivity across Android devices

开发者 https://www.devze.com 2023-03-05 04:43 出处:网络
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 scr

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 ?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号