CompactCalendarView icon indicating copy to clipboard operation
CompactCalendarView copied to clipboard

Need Current date and select date background in squre shape

Open dheerajjaiswal08 opened this issue 8 years ago • 2 comments

Sir I want to make the current date and selected date in square shape. How do I achieve this. Please help.

Thanks...

dheerajjaiswal08 avatar Sep 18 '17 05:09 dheerajjaiswal08

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.

SundeepK avatar Sep 18 '17 20:09 SundeepK

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 Screenshot_20221122_150210

aneebarshad avatar Nov 22 '22 10:11 aneebarshad