Skip to content

Ulez/AnimatorLib

Repository files navigation

AnimatorLib

贝塞尔曲线属性动画的封装。

Usage in activity

@Override
    public void onClick(View view) {
        AnimatorPath path = new AnimatorPath.Builder()
                .moveTo(0, 0)
                .quadTo(-300, 800, -600, 0)
                .lineTo(0, 0)
                .cubicTo(-200, 200, -400, 100, -600, 0)
                .lineTo(0, 0)
                .build();
        ObjectAnimator animator = ObjectAnimator
                .ofObject(this, "location", new PathEvaluator(), path.getPoints())
                .setDuration(4000);
        animator.setInterpolator(new LinearInterpolator());
        animator.start();
    }

    public void setLocation(PathPoint p) {
        textView.setTranslationX(p.x);
        textView.setTranslationY(p.y);
    }

About

贝塞尔曲线属性动画的封装。

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages