PATRIK27 / osmdroid

Automatically exported from code.google.com/p/osmdroid
0 stars 0 forks source link

Change onAnimationEnd listener to (hopefully) fix a few bugs #230

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
In  Issue 136  I tried implement a fix for a visual bug where, when zooming, 
the animation would throw a couple of bad frames at the end. The issue was 
related to the fact that onAnimationEnd isn't accurate:

http://code.google.com/p/android-misc-widgets/issues/detail?id=8

I tried to push all of the actions from onAnimationEnd to the main UI thread, 
hoping that it could be synchronized with drawing the screen on that handler. 
It seemed to work at the time, but now appears to be not working.

There is an additional error that I highly believe is related to this issue. If 
you double-tap on the map rapidly, eventually one of the zooms "overlaps" the 
other and the center of the map is offset by MapSize(zoomLevel) / 2 and that 
puts you somewhere far off from your original location. I debugged this from 
many different angles, and the only fix appears to be removing the 
onAnimationEnd post() to the UI thread.

There appears to be a solution here:
http://stackoverflow.com/questions/4750939/android-animation-is-not-finished-in-
onanimationend/5110476#5110476

and it simply states that we should use the View's onAnimationEnd rather than 
the AnimationListener. I suggest we implement this!

Original issue reported on code.google.com by kurtzm...@gmail.com on 16 Jun 2011 at 8:25

GoogleCodeExporter commented 8 years ago
Issue 204 may be related to this.

Original comment by kurtzm...@gmail.com on 16 Jun 2011 at 8:26

GoogleCodeExporter commented 8 years ago
Patch attached!

So far, it works for me!

Original comment by kurtzm...@gmail.com on 16 Jun 2011 at 8:43

Attachments:

GoogleCodeExporter commented 8 years ago
The zoom issue (jumping to a bad location) is still present for me. However, 
the visual bugs were no longer present.

Original comment by kurtzm...@gmail.com on 16 Jun 2011 at 9:20

GoogleCodeExporter commented 8 years ago
I have been using this patch for a week and it appears to fix the visual errors 
associated with onAnimationEnd so I will go ahead and commit it. I am going to 
keep the issue open a little longer to try and further investigate the 
double-click zoom issue.

Original comment by kurtzm...@gmail.com on 27 Jun 2011 at 7:04

GoogleCodeExporter commented 8 years ago
Added in r944.

Original comment by kurtzm...@gmail.com on 27 Jun 2011 at 7:12

GoogleCodeExporter commented 8 years ago

Original comment by kurtzm...@gmail.com on 27 Jun 2011 at 8:07

GoogleCodeExporter commented 8 years ago
there's still an issue with the zoom in that maybe is related to this issue.

when zoom in with the zoom in button, the map center should stay fixed on the 
same center it was.

sometimes the offset is vertical and sometimes horizontal 

Original comment by ori.kle...@gmail.com on 1 Aug 2011 at 11:34

GoogleCodeExporter commented 8 years ago
this patch seemed to fix my zoom issue. map stays centered for me now.

Original comment by christop...@gmail.com on 10 Jan 2012 at 2:58

GoogleCodeExporter commented 8 years ago
The double-tap zoom issue was fixed in another issue. This can be closed.

Original comment by kurtzm...@gmail.com on 25 Jan 2013 at 8:12