Indicate the source and author's contact information during reprinting.
ArticleSource: http://www.limodev.cn/blog
Author contact: Li xianjing <xianjimli@gmail.com>
Although ftk supports window animation for a long time, as an animation implementer, I have to admit that the animation implementation before ftk version 0.6 is very poor. The main reasons are as follows:
1. The animation speed is a single uniform motion.
2. The number of animation frames cannot change with the hardware performance.
3. The animation only includes the entry (Display) animation of the window, but does not have the exit (close) animation of the window.
4. The animation mechanism is not integrated into the GUI and must be created and called by the user, which is troublesome to use.
Some time ago, it took a lot of time to study the implementation of Android GUI because of work. I paid special attention to its animation implementation, and I was inspired by it. Recently, we have re-implemented the ftk animation mechanism, which draws on the android animation principle to a large extent. Of course, there are great differences in implementation. Here is a brief introduction to the implementation of ftk window Animation:
Relationship between the animation running time and the animation running Progress
If the animation moves at a constant speed, the time and position are linearly related. For example, if the time is over 50%, the animation runs to the position of 50%. However, the motion of the implemented object may be accelerated or reduced.
Speed movement or ball rebound, if all the window animation uses a uniform motion, it is difficult to achieve the ideal animation effect. To solve this problem, we introduce an interpolation device (interpolator)
To realize the transformation between time and position.
Please read the PDF document.