为了账号安全,请及时绑定邮箱和手机立即绑定

来这是释放动画的方法

//释放动画
private ValueAnimator valueAnimator;
/**
* 添加释放操作
*/
public void release(){
   if(valueAnimator == null){
       final ValueAnimator animator = ValueAnimator.ofFloat(mProgress,0f);
       animator.setInterpolator(new DecelerateInterpolator());
       animator.setDuration(400);
       animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
           @Override
           public void onAnimationUpdate(ValueAnimator valueAnimator) {
               Object val = valueAnimator.getAnimatedValue();
               if(val instanceof Float){
                   setProgress((Float) val);
               }
           }
       });
       valueAnimator = animator;
   }else {
       valueAnimator.cancel();
       valueAnimator.setFloatValues(mProgress,0f);

   }
   valueAnimator.start();
}

正在回答

1 回答

举报

0/150
提交
取消

来这是释放动画的方法

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信