During the past few months, I built an open-source tweening engine in Java (Universal Tween Engine) to be able to easily add smooth animations and transitions to my android games. It works like a breeze for games and is successfully used by many people (mostly in the LibGDX community). The library is generic and can be used to animate anything (Swing UI components, opengl game objects, etc). Now, I want to create an addon to the lib dedicated to android UIs, since I believe it can greatly ease the creation of very complex animations compared to the built-in animation framework.
My lib exposes a .update(float deltaTime)
method that has to be called each time you want to update all the running animations. It was tailored for games since every game exposes an infinite loop, but that's not the case for UIs.
Therefore, I was wondering how the animation framework of the Android API works under the hood. Is there a static thread dedicated to animations that runs continuously and updates animations frame-by-frame and get paused until there is a new animation running?
I was thinking about something like that, but I'm not really happy with this code since it doesn't take the device refresh rate into account for instance.