public static void setBackgroundWithRipple(View clickedView, final View backgroundView,
                                               final View bgOverlay, final int newColor, int animationDuration) {
        int centerX = 0;
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
            centerX = (int) (clickedView.getX() + (clickedView.getMeasuredWidth() / 2));
        }else{
            centerX = (int) (clickedView.getLeft() + (clickedView.getMeasuredWidth() / 2));
        }
        int centerY = clickedView.getMeasuredHeight() / 2;
        int finalRadius = backgroundView.getWidth();

        backgroundView.clearAnimation();
        bgOverlay.clearAnimation();

        Animator circularReveal = null;

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            circularReveal = ViewAnimationUtils
                    .createCircularReveal(bgOverlay, centerX, centerY, 0, finalRadius);
        } else {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
                bgOverlay.setAlpha(0);
                circularReveal = ObjectAnimator.ofFloat(bgOverlay, "alpha", 0, 1);
            }
        }

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
            circularReveal.setDuration(animationDuration);
            circularReveal.addListener(new AnimatorListenerAdapter() {
                @Override
                public void onAnimationEnd(Animator animation) {
                    onCancel();
                }

                @Override
                public void onAnimationCancel(Animator animation) {
                    onCancel();
                }

                private void onCancel() {
                    backgroundView.setBackgroundColor(newColor);
                    bgOverlay.setVisibility(View.GONE);
                }
            });
        }

        bgOverlay.setBackgroundColor(newColor);
        bgOverlay.setVisibility(View.VISIBLE);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
            circularReveal.start();
        }
    }
Used to set the ripple animation when a tab is selected

@param clickedView       the view that is clicked (to get dimens where ripple starts)
@param backgroundView    temporary view to which final background color is set
@param bgOverlay         temporary view which is animated to get ripple effect
@param newColor          the new color i.e ripple color
@param animationDuration duration for which animation runs
common/src/main/java/com/sxjs/common/widget/bottomnavigation/BottomNavigationHelper.java