This is a calendar library that gives integration for the year View starting with Current month. It uses pagination3 under the hood.
With Compose getting the attention, it was about time to have its own Calendar. Kalendar is all
about it with the customization and design.
To add Kalendar, add this dependency,
dependencies {
.....
implementation("com.himanshoe:kalendar-endlos:1.0.0")
}
To integrate Kalendar use the composable,
Kalendar()
With Kalendar at your disposal you have customization at your tip to make it suited based on your need.
Kalendar
composable has lot of optional parameters that you can use. Like,
KalendarHeader
If you want to configure the KalendarHeader, use:
kalendarHeaderConfig : KalendarHeaderConfig
Setting up Events
kalendarEvents: List<KalendarEvent> = emptyList(),
Here, KalendarEvent
can be used to pass events to mark specific days. KalendarEvent
looks like,
data class KalendarEvent(
val date: LocalDate,
val eventName: String,
val eventDescription: String? = null, )
Setting up KalendarThemeColors
kalendarThemeColors: List<KalendarThemeColor> = KalendarColors.defaultColors(),
Here, KalendarThemeColor
list can be used to pass the basic theming colors that will be common for all the Views.
PS: I would say check the defaultColors
once as well!
KalendarThemeColor
looks like,
data class KalendarThemeColor(
val backgroundColor: Color,
val dayBackgroundColor: Color,
val headerTextColor: Color, )
Alternatively,
if you dont want each month having its own color set, you can use,
kalendarThemeColor: KalendarThemeColor = //Your color,
Individual Date Click Listener
onCurrentDayClick: (KalendarDay, List<KalendarEvent>) -> Unit = { _, _ -> },
You can use this lambda to get values of the specific day that is in format of,
class KalendarDay(val localDate: LocalDate)
and the list of events for that particular day.
Setting up Colors for Individual Day
kalendarDayColors: KalendarDayColors = KalendarDayDefaultColors.defaultColors()
This will have list of two colors,
- First one for default color
- Second one for the color it will come when it is selected.