• 【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:动画从开始到结束,变化率是线性变化。

  • 相关阅读:
    装饰器 无惨固定模式 和 有参装饰器的固定模式
    匿名函数
    字典生成式
    列表生成式
    Centos7安装配置apache-tomcat-8.5.16.tar.gz
    Centos7安装配置jdk-8u151-linux-x64.tar.gz
    Linux CentOS7源码安装配置mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz
    VirtualBox新建Centos7虚拟系统
    vmware workstation 10的安装
    redhat linux rpm包安装配置mysql数据库
  • 原文地址:https://www.cnblogs.com/rayray/p/3373691.html
Copyright © 2020-2023  润新知