Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the android relevant of CADisplayLink(iOS) or CompositionTarget(WP)

I need to update my animations per frame, on iOS I have CADisplayLink, on WinPhone I have CompositionTarget, but how do I do that on Android?

Currently I'm using a Timer alongside a Handler, but I believe there is a way to sync the callback with the refresh rate.

like image 544
horeaper Avatar asked Jan 25 '13 09:01

horeaper


1 Answers

The most direct equivalent I'm aware of is Choreographer (as of API 16).

It looks like how your animations are written determines the best way to sync it. Choreographer is not generally useful. Choreographer is useful if your animation is written outside of the "animation framework" which AFAIK includes ViewPropertyAnimator and ... maybe XML defined animations? Exactly what is undocumented.

Choreographer looks like it's mainly useful for syncing GLSurfaceView animations.

like image 88
nmr Avatar answered Sep 18 '22 15:09

nmr