- Add it in your root build.gradle
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
- Add the dependency
dependencies {
implementation 'com.github.uuranus:schedule-calendar-compose:latest_version'
}
ScheduleCalendar(
schedules = mapOf(
ScheduleDate.create(2024, 6, 1) to ScheduleInfo(
isCheckNeeded = false,
schedules = listOf(
ScheduleData(
title = "schedule1",
color = Purple,
detail = "Schedule Info 1",
)
)
),
)
)
- The data structure looks like this.
- You can set a class that contains more detailed schedule information through generics.
- Starts on Monday, with no distinction in color for weekends.
ScheduleCalendar(
schedules = schedules,
isMondayFirst = false
)
ScheduleCalendar(
schedules = schedules,
calendarColors = ScheduleCalendarDefaults.colors(
lightColors = ScheduleCalendarDefaults.defaultLightColors().copy(
saturdayColor = Blue,
sundayColor = Red
),
darkColors = ScheduleCalendarDefaults.defaultDarkColors().copy(
saturdayColor = DarkBlue,
sundayColor = DarkRed
),
)
)
- The color of the schedule is set to the Light version and automatically changes to Dark mode.
- the names of the days and months to reflect the system's language and you can modify the format of the year and month.
ScheduleCalendar(
schedules = schedules,
calendarFormat = ScheduleCalendarDefaults.formats().copy(
monthHeaderFormat = "MMMM YYYY"
)
)
This project is licensed under the MIT License - see the LICENSE file for details.