【Android】详解Android动画之Interpolator插入器


Interpolator英文意思是: 篡改者; 分类机; 校对机

SDK对Interpolator的描述是:An interpolator defines the rate of change of an animation. This allows the basic animation effects (alpha, scale, translate, rotate) to be accelerated, decelerated, repeated, etc。简而言之Interpolator就是一个“变化率”,一个基本动画的“变化率”。
比如:从A到B的一个平移动画,移动,当然后速度的快慢,那么从A到B可以是匀速、匀加速、匀减速、变速完成这段距离。假设距离为S,时间为t,速度为v,都知道S=v*t。
这个Interpolator在这里就是一个速度控制器,控制速度变化。先给一个对Interpolator的大概理解,接下来站在程序员的角度来认识Interpolator。
Interpolator借口只有一个抽象方法getInterpolation(float input),

由此SDK中扩展了另外几个常用Interpolator类,分别是:


——AccelerateInterpolator:动画从开始到结束,变化率是一个加速的过程。
——DecelerateInterpolator:动画从开始到结束,变化率是一个减速的过程。
——CycleInterpolator:动画从开始到结束,变化率是循环给定次数的正弦曲线。
——AccelerateDecelerateInterpolator:动画从开始到结束,变化率是先加速后减速的过程。
——LinearInterpolator:动画从开始到结束,变化率是线性变化。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM