反向动画android

时间:2015-06-21 15:27:47

标签: java android android-animation objectanimator

我该怎样扭转这个动画?

        path = new AnimatorPath();
        path.moveTo(0, 0);
        path.curveTo(-200, 200, -400, 100, -600, 50);

        anim = ObjectAnimator.ofObject(this, "fabLoc", new PathEvaluator(), path.getPoints().toArray());

        anim.setInterpolator(new AccelerateInterpolator());
        anim.setDuration(ANIMATION_DURATION);
        anim.start();

我试过这种方式,但它不起作用:

List<PathPoint> points = new ArrayList<>(path.getPoints());
                Collections.reverse(points);

                anim = ObjectAnimator.ofObject(this, "fabLoc", new PathEvaluator(),
                        points.toArray());

当我点击我创建的按钮时,应该反转动画没有任何反应

0 个答案:

没有答案