eng-leandroalves / android-page-curl

Automatically exported from code.google.com/p/android-page-curl
0 stars 0 forks source link

onTouchEvent blocks as page is flipping, however when it wakes it is possible to skip critical touch events #6

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

Flip the first page and while that page is performing its page curling 
animation touch and HOLD triggering another series of motion events 
(ACTION_DOWN and ACTION_MOVE)

The line:   if(!bBlockTouchInput) in the method onTouchEvent()      
should be blocking any additional motion events from happening while the page 
curl is curling.  

When the page curl animation is finished the variable
bBlockTouchInput is set to false, and motion events are unblocked again, 
however it might allow us to unblocked when we are performing an ACTION_MOVE or 
ACTION_UP event. Therefore it is possible to become out of sync with our 
expected order of touch events because the ACTION_DOWN event was blocked during 
the page curl animation.

To fix in my code I added a flag in the ACTION_DOWN case that gets set, and 
only gets unset in the ACTION_UP case.  Then I added logic to the ACTION_MOVE 
and ACTION_UP cases to break if that flag isn't set.  Now if the onTouchEvent 
wakes up while I am performing something other than ACTION_DOWN, no code is run 
until the next ACTION_DOWN.

Original issue reported on code.google.com by james.j....@gmail.com on 4 Jun 2011 at 11:42

GoogleCodeExporter commented 8 years ago
Could you send a changeset to review and merge your changes?

Original comment by B.Thax....@gmail.com on 23 Aug 2011 at 10:22