FlyRefreshLayout.java 文件源码

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

项目:binea_project_for_android 作者:
@Override
protected void onStartRefreshAnimation() {
    if(mFlyAnimator != null){
        mFlyAnimator.end();
    }
    final View iconView = getActionView();
    UIUtils.clearAnimator(iconView);

    AnimatorSet flyUpAnim = new AnimatorSet();
    flyUpAnim.setDuration(800);

    ObjectAnimator transX = ObjectAnimator.ofFloat(iconView, "translationX", 0, getWidth());
    ObjectAnimator transY = ObjectAnimator.ofFloat(iconView, "translationY", 0, -mHeaderController.getHeight());
    transY.setInterpolator(PathInterpolatorCompat.create(0.7f, 1f));
    ObjectAnimator rotation = ObjectAnimator.ofFloat(iconView, "rotation", -45, 0);
    rotation.setInterpolator(new DecelerateInterpolator());
    ObjectAnimator rotationX = ObjectAnimator.ofFloat(iconView, "rotationX", 0, 60);
    rotationX.setInterpolator(new DecelerateInterpolator());

    flyUpAnim.playTogether(transX, transY, rotationX,
            ObjectAnimator.ofFloat(iconView, "scaleX", 1, 0.5f),
            ObjectAnimator.ofFloat(iconView, "scaleY", 1, 0.5f),
            rotation
    );

    mFlyAnimator = flyUpAnim;
    mFlyAnimator.start();

    if (mListener != null) {
        mListener.onRefresh(FlyRefreshLayout.this);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号