PieChartRotationAnimatorV8.java 文件源码

java
阅读 26 收藏 0 点赞 0 评论 0

项目:boohee_v5.6 作者:
public PieChartRotationAnimatorV8(PieChartView chart, long duration) {
    this.interpolator = new AccelerateDecelerateInterpolator();
    this.isAnimationStarted = false;
    this.startRotation = 0.0f;
    this.targetRotation = 0.0f;
    this.animationListener = new DummyChartAnimationListener();
    this.runnable = new Runnable() {
        public void run() {
            long elapsed = SystemClock.uptimeMillis() - PieChartRotationAnimatorV8.this.start;
            if (elapsed > PieChartRotationAnimatorV8.this.duration) {
                PieChartRotationAnimatorV8.this.isAnimationStarted = false;
                PieChartRotationAnimatorV8.this.handler.removeCallbacks(PieChartRotationAnimatorV8.this.runnable);
                PieChartRotationAnimatorV8.this.chart.setChartRotation((int) PieChartRotationAnimatorV8.this.targetRotation, false);
                PieChartRotationAnimatorV8.this.animationListener.onAnimationFinished();
                return;
            }
            PieChartRotationAnimatorV8.this.chart.setChartRotation((int) ((((PieChartRotationAnimatorV8.this.startRotation + ((PieChartRotationAnimatorV8.this.targetRotation - PieChartRotationAnimatorV8.this.startRotation) * Math.min(PieChartRotationAnimatorV8.this.interpolator.getInterpolation(((float) elapsed) / ((float) PieChartRotationAnimatorV8.this.duration)), 1.0f))) % 360.0f) + 360.0f) % 360.0f), false);
            PieChartRotationAnimatorV8.this.handler.postDelayed(this, 16);
        }
    };
    this.chart = chart;
    this.duration = duration;
    this.handler = new Handler();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号