@Override
public void startRefresh() {
if (mFlyAnimator != null) {
mFlyAnimator.end();
}
final View iconView = getIconView();
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);
}
}
FlyRefreshLayout.java 文件源码
java
阅读 28
收藏 0
点赞 0
评论 0
项目:FlyRefresh
作者:
评论列表
文章目录