I'm animating a an ImageView from the left to the right of the screen using a translate animation. The ImageView is place inside a RelativeLayout over the top of my main layout using FrameLayout.
When I run the animation on the emulator everything works pretty well but when I use run it on my G1 it leaves visual artifacts behind and effects the rendering of the text component behind it.
Is this a performance issue and I'm being too ambitious or is it a bug I can overcome?
If it is a performance issue is there anything I can do to improve things?
I was also experiencing the same issue on 2.3.
Invalidating the container of the moving view ( the layout in which the moving view resides ) in Animation.applyTransformation fixed it for me.
See:
Android - Artifacts using Animation
I now this may be a little old, but I just found this:
http://groups.google.com/group/android-developers/browse_thread/thread/5481450f8b71a26c/e750730b9953d9a8?lnk=gst&q=animation+leaves+trails#e750730b9953d9a8
Not sure what android version your using, but it may be a bug in the android libraries!
Looks like that's what the problem is for me! :)
... Dontcha just love it when its not your fault! :D
Here's a workaround I found that solved this for me: "An easy workaround would be to pad your image with a small (1 pixel should do it) transparent region on the right/bottom - this would have no effect on how it would look, but it would force an invalidation of a region slightly larger than the actual image and thus compensate for the bug."
http://code.google.com/p/android/issues/detail?id=22151
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With