StackTipsLab/custom-calendar-view

how can i change rectangular cell view to circular cell view

Closed this issue · 1 comments

how can i change rectangular cell view to circular cell view

Open layout files roboto_calendar_week_N.xml
In each file modify layout_width of com.imanoweb.calendarview.DayView so that android:layout_width="wrap_content"
Create a new drawable selected_date_shape.xml and insert following code in it

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="oval">
    <size android:width="40dp" />
</shape>

Open file CustomCalendarView.java and navigate to method markDayAsSelectedDay
Replace line view.setBackgroundColor(selectedDayBackgroundColor); with

view.setBackgroundResource(R.drawable.selected_date_shape);
((GradientDrawable)view.getBackground()).setColor(selectedDayBackground);