CompactCalendarView
CompactCalendarView copied to clipboard
Need Current date and select date background in squre shape
Sir I want to make the current date and selected date in square shape. How do I achieve this. Please help.
Thanks...
This should be fairly simple but you'll need to take a fork of the code and change this line: https://github.com/SundeepK/CompactCalendarView/blob/master/library/src/main/java/com/github/sundeepk/compactcalendarview/CompactCalendarController.java#L887 to instead draw a Rect object instead of a cirlce.
selected date in a square shape with a radius and without a radius by replacing the last function of CompactCalendarController with this
private void drawCircle(Canvas canvas, float radius, float x, float y) {
// canvas.drawCircle(x, y, radius, dayPaint); // circle default
float left = x - 50;
float top = y - 50;
RectF myRectum = new RectF(left, top, left + 100, top + 100);
// canvas.drawRect(myRectum, dayPaint); // simple rectangle box
canvas.drawRoundRect(myRectum,15,15, dayPaint); // rectangle with radius
}
The final result look like this
