zoukankan      html  css  js  c++  java
  • 【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:动画从开始到结束,变化率是线性变化。

  • 相关阅读:
    Manjaro19.0.2 electron-酸酸乳 无法添加订阅地址
    cnblogs美化技巧
    manjaro19.0.2+typora+PicGo
    剑指offer 面试题7.重建二叉树
    剑指offer 面试题6.从尾到头打印链表
    add sudo user
    tensorflow 禁用 gpu
    kill screen detached session
    git 修改远程仓库链接
    grub 分辨率修改
  • 原文地址:https://www.cnblogs.com/rayray/p/3373691.html
Copyright © 2011-2022 走看看