@Override
    protected void onSizeChanged(int w, int h, int oldw, int oldh) {
        super.onSizeChanged(w, h, oldw, oldh);
        if (size == -1) {
            // Default size if full view
            size = w;
        }
    }
Simple view to draw a colored and sized dot
library/src/main/java/com/github/badoualy/datepicker/DotView.java