HeartProgressView.java 文件源码

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

项目:XProgressDialog 作者:
public void start() {
    this.isStopped = false;

    leftHeartX = width / 4 + width / 8;
    leftHeartY = height / 4 + height / 8;

    PropertyValuesHolder widthPropertyHolder = PropertyValuesHolder.ofFloat(POSITION_X, width / 4 + width / 8, width / 2 + width / 8);
    PropertyValuesHolder heightPropertyHolder = PropertyValuesHolder.ofFloat(POSITION_Y, height / 4 + height / 8, height / 2 + height / 8);
    animatorLeftHeart = ValueAnimator.ofPropertyValuesHolder(widthPropertyHolder, heightPropertyHolder);
    animatorLeftHeart.setDuration(2000);
    animatorLeftHeart.setStartDelay(1000);
    animatorLeftHeart.setInterpolator(new AnticipateOvershootInterpolator());
    animatorLeftHeart.addUpdateListener(leftHeartAnimationUpdateListener);
    animatorLeftHeart.setRepeatMode(ValueAnimator.REVERSE);
    animatorLeftHeart.setRepeatCount(ValueAnimator.INFINITE);

    widthPropertyHolder = PropertyValuesHolder.ofFloat(POSITION_X, width / 2 + width / 8, width / 4 + width / 8);
    heightPropertyHolder = PropertyValuesHolder.ofFloat(POSITION_Y, height / 4 + height / 8, height / 2 + height / 8);
    animatorRightHeart = ValueAnimator.ofPropertyValuesHolder(widthPropertyHolder, heightPropertyHolder);
    animatorRightHeart.setDuration(2000);
    animatorRightHeart.setInterpolator(new AnticipateOvershootInterpolator());
    animatorRightHeart.addUpdateListener(rightHeartAnimationUpdateListener);
    animatorRightHeart.setRepeatCount(ValueAnimator.INFINITE);
    animatorRightHeart.setRepeatMode(ValueAnimator.REVERSE);

    animatorRightHeart.start();
    animatorLeftHeart.start();

    invalidate();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号