zoukankan      html  css  js  c++  java
  • Android 数字动画

    Android 数字动画

    /**
    * 动画显示数字
    * Created by fhp on 15/1/7.
    */
    public class CountView extends NumberView{
    //动画时长 ms
    int duration = 1500;
    float number;
    public CountView(Context context, AttributeSet attrs) {
    super(context, attrs);
    }
    public void showNumberWithAnimation(float number) {
    //修改number属性,会调用setNumber方法
    ObjectAnimator objectAnimator=ObjectAnimator.ofFloat(this,”number”,0,number);
    objectAnimator.setDuration(duration);
    //加速器,从慢到快到再到慢
    objectAnimator.setInterpolator(new AccelerateDecelerateInterpolator());
    objectAnimator.start();
    }
    public float getNumber() {
    return number;
    }
    public void setNumber(float number) {
    this.number = number;
    setText(String.format(“%1$07.2f”,number));
    }
    }

  • 相关阅读:
    IfcQuantityWeight
    IfcPhysicalComplexQuantity
    IfcBinary
    大服务器
    DFF环境配置
    Java程序设置为开机自启动
    IfcArbitraryProfileDefWithVoids
    定位日志
    blazor相关资料
    老人与海 电影
  • 原文地址:https://www.cnblogs.com/allencoder/p/4830744.html
Copyright © 2011-2022 走看看