Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interpolators don't appear to have an effect #126

Open
Ninjars opened this issue Jun 12, 2018 · 1 comment
Open

Interpolators don't appear to have an effect #126

Ninjars opened this issue Jun 12, 2018 · 1 comment

Comments

@Ninjars
Copy link

Ninjars commented Jun 12, 2018

class CircularRevealAnimator {
    public static Animator createCentered(View view, Animator.AnimatorListener listener) {
        // get the center for the clipping circle
        int cx = (view.getLeft() + view.getRight()) / 2;
        int cy = (view.getTop() + view.getBottom()) / 2;

        // get the final radius for the clipping circle
        int dx = Math.max(cx, view.getWidth() - cx);
        int dy = Math.max(cy, view.getHeight() - cy);
        float finalRadius = (float) Math.hypot(dx, dy);

        Animator animator = ViewAnimationUtils.createCircularReveal(view, cx, cy, 0, finalRadius);

        animator.setInterpolator(new BounceInterpolator());

        animator.setDuration(view.getResources().getInteger(android.R.integer.config_mediumAnimTime));
        animator.addListener(listener);

        return animator;
    }
}

... CircularRevealAnimator.createCentered(revealView, animatorListener).start() ...

No matter what interpolator I attempt to set in here, the reveal animation plays linearly.

@ozodrukh
Copy link
Owner

hm, can't tell anything, it actually should work. Can you tell me whether pre-Lollipop or native animator doesn't plays interpolation effect?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants