MainActivity.java 文件源码

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

项目:CircleReveal 作者:
private void executeCardsSequentialAnimation() {
  final int length = cardsLine.getChildCount();
  cardsLine.setVisibility(View.VISIBLE);

  final Animator[] animators = new Animator[length];
  for (int i = 0; i < length; i++) {
    View target = cardsLine.getChildAt(i);
    final float x0 = 0;// i == 0 ? 0 : -10 * (1 + i * 0.2f);
    final float y0 = 10 * i;

    target.setTranslationX(x0);
    target.setTranslationY(y0);

    AnimatorPath path = new AnimatorPath();
    path.moveTo(x0, y0);
    path.lineTo(0, 0);

    PathPoint[] points = new PathPoint[path.getPoints().size()];
    path.getPoints().toArray(points);

    AnimatorSet set = new AnimatorSet();
    set.play(ObjectAnimator.ofObject(target, PATH_POINT, new PathEvaluator(), points))
        .with(ObjectAnimator.ofFloat(target, View.ALPHA, 0.8f, 1f));

    animators[i] = set;
    animators[i].setStartDelay(15 * i);
  }

  final AnimatorSet sequential = new AnimatorSet();
  sequential.playTogether(animators);
  sequential.setInterpolator(new FastOutLinearInInterpolator());
  sequential.setDuration(FAST_DURATION);
  sequential.start();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号