前言
Intepolator是Android動畫系統中極其重要的一個組件,能夠對動畫的實際效果產生很大影響。下面對Android系統內置的幾種Intepolator的效果進行演示。
AccelerateDecelerateInterpolator
An interpolator where the rate of change starts and ends slowly but accelerates through the middle.
開始與結束時慢,中間加速。
AccelerateInterpolator
An interpolator where the rate of change starts out slowly and and then accelerates.
開始慢,之後加速。
AnticipateInterpolator
An interpolator where the change starts backward then flings forward.
開始時先後退,然後向前猛衝。
AnticipateOvershootInterpolator
An interpolator where the change starts backward then flings forward and overshoots the target value and finally goes back to the final value.
開始時先後退,然後向前猛衝越過終點,最後再後退到終點位置。
BounceInterpolator
An interpolator where the change bounces at the end.
在結尾處反彈直至停止。
CycleInterpolator
Repeats the animation for a specified number of cycles. The rate of change follows a sinusoidal pattern.
動畫會反覆多次,速率符合正弦曲線。
DecelerateInterpolator
An interpolator where the rate of change starts out quickly and and then decelerates.
開始時快,之後減速。
LinearInterpolator
An interpolator where the rate of change is constant
速率保持不變。
OvershootInterpolator
An interpolator where the change flings forward and overshoots the last value then comes back.
猛衝越過終點然後返回。