@Nullable
    private Animator createAnimator(@NonNull final View animatedView, @NonNull final View rootView,
                                    @NonNull final CircleRevealAnimation animation,
                                    @Nullable final AnimatorListener listener, final boolean show) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            long duration = getDuration(animatedView, animation);
            int horizontalDistance = Math.max(Math.abs(rootView.getLeft() - animation.getX()),
                    Math.abs(rootView.getRight() - animation.getX()));
            int verticalDistance = Math.max(Math.abs(rootView.getTop() - animation.getY()),
                    Math.abs(rootView.getBottom() - animation.getY()));
            float maxRadius = (float) Math
                    .sqrt(Math.pow(horizontalDistance, 2) + Math.pow(verticalDistance, 2));
            Animator animator = ViewAnimationUtils
                    .createCircularReveal(animatedView, animation.getX(), animation.getY(),
                            show ? animation.getRadius() : maxRadius,
                            show ? maxRadius : animation.getRadius());
            animator.setInterpolator(animation.getInterpolator());
            animator.setStartDelay(animation.getStartDelay());
            animator.setDuration(duration);

            if (listener != null) {
                animator.addListener(listener);
            }

            if (animation.getAlpha() != null) {
                ObjectAnimator alphaAnimator = ObjectAnimator
                        .ofFloat(animatedView, "alpha", show ? animation.getAlpha() : 1,
                                show ? 1 : animation.getAlpha());
                alphaAnimator.setInterpolator(animation.getInterpolator());
                alphaAnimator.setStartDelay(animation.getStartDelay());
                alphaAnimator.setDuration(duration);
                AnimatorSet animatorSet = new AnimatorSet();
                animatorSet.playTogether(animator, alphaAnimator);
                return animatorSet;
            }

            return animator;
        }

        return null;
    }
@ Nullable private Animator createAnimator ( @ NonNull final View animatedView , @ NonNull final View rootView , @ NonNull final CircleRevealAnimation animation , @ Nullable final AnimatorListener listener , final boolean show ) { if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . LOLLIPOP ) { long duration = getDuration ( animatedView , animation ) ; int horizontalDistance = Math . max ( Math . abs ( rootView . getLeft ( ) - animation . getX ( ) ) , Math . abs ( rootView . getRight ( ) - animation . getX ( ) ) ) ; int verticalDistance = Math . max ( Math . abs ( rootView . getTop ( ) - animation . getY ( ) ) , Math . abs ( rootView . getBottom ( ) - animation . getY ( ) ) ) ; float maxRadius = ( float ) Math . sqrt ( Math . pow ( horizontalDistance , 2 ) + Math . pow ( verticalDistance , 2 ) ) ; Animator animator = ViewAnimationUtils . createCircularReveal ( animatedView , animation . getX ( ) , animation . getY ( ) , show ? animation . getRadius ( ) : maxRadius , show ? maxRadius : animation . getRadius ( ) ) ; animator . setInterpolator ( animation . getInterpolator ( ) ) ; animator . setStartDelay ( animation . getStartDelay ( ) ) ; animator . setDuration ( duration ) ; if ( listener != null ) { animator . addListener ( listener ) ; } if ( animation . getAlpha ( ) != null ) { ObjectAnimator alphaAnimator = ObjectAnimator . ofFloat ( animatedView , "alpha" , show ? animation . getAlpha ( ) : 1 , show ? 1 : animation . getAlpha ( ) ) ; alphaAnimator . setInterpolator ( animation . getInterpolator ( ) ) ; alphaAnimator . setStartDelay ( animation . getStartDelay ( ) ) ; alphaAnimator . setDuration ( duration ) ; AnimatorSet animatorSet = new AnimatorSet ( ) ; animatorSet . playTogether ( animator , alphaAnimator ) ; return animatorSet ; } return animator ; } return null ; }
Creates an animator, which should be used for a circle reveal animation.

@param animatedView
The animated view as an instance of the class {@link View}. The view may not be null
@param rootView
The root view of the dialog as an instance of the class {@link View}. The view may
not be null
@param animation
The animation as an instance of the class {@link CircleRevealAnimation}. The
animation may not be null
@param listener
The listener, which should be notified about the animation's events, as an instance
of type {@link AnimatorListener} or null, if no listener should be notified
@param show
True, if the animation should be used for showing the dialog, false otherwise
@return The animator, which has been created, as an instance of the class {@link Animator} or
null, if no animation should be used