private void drawUnselected(Canvas canvas) {

        combinedUnselectedPath.rewind();

        // draw any settled, revealing or joining dots
        for (int page = 0; page < pageCount; page++) {
            int nextXIndex = page == pageCount - 1 ? page : page + 1;
            Path unselectedPath = getUnselectedPath(page,
                    dotCenterX[page],
                    dotCenterX[nextXIndex],
                    page == pageCount - 1 ? INVALID_FRACTION : joiningFractions[page],
                    dotRevealFractions[page]);
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
                combinedUnselectedPath.op(unselectedPath, Path.Op.UNION);
            } else {
                combinedUnselectedPath.addPath(unselectedPath);
            }
        }
        // draw any retreating joins
        if (retreatingJoinX1 != INVALID_FRACTION) {
            Path retreatingJoinPath = getRetreatingJoinPath();
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
                combinedUnselectedPath.op(retreatingJoinPath, Path.Op.UNION);
            } else {
                combinedUnselectedPath.addPath(retreatingJoinPath);
            }
        }
        canvas.drawPath(combinedUnselectedPath, unselectedPaint);
    }
An ink inspired widget for indicating pages in a {@link ViewPager}.
library/src/main/java/com/heinrichreimersoftware/materialintro/view/InkPageIndicator.java