Skip to content

uuranus/schedule-calendar-compose

Repository files navigation

Schedule Calendar

schedule-calendar

Download

  1. Add it in your root build.gradle
dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url 'https://jitpack.io' }
		}
	}
  1. Add the dependency
dependencies {
	        implementation 'com.github.uuranus:schedule-calendar-compose:latest_version'
	}

Usage

Adding Data

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.
스케줄 데이터 구조

Customizing the Date

Default

  • Starts on Monday, with no distinction in color for weekends.
기본값 스크린샷

From Sunday

 ScheduleCalendar(
        schedules = schedules,
        isMondayFirst = false
    )
일요일 first

Weekend Coloring

 ScheduleCalendar(
        schedules = schedules,
        calendarColors = ScheduleCalendarDefaults.colors(
            lightColors = ScheduleCalendarDefaults.defaultLightColors().copy(
                saturdayColor = Blue,
                sundayColor = Red
            ),
            darkColors = ScheduleCalendarDefaults.defaultDarkColors().copy(
                saturdayColor = DarkBlue,
                sundayColor = DarkRed
            ),
        )
    )
주말 색깔 first

DarkMode

  • The color of the schedule is set to the Light version and automatically changes to Dark mode.
다크 모드 first

YearMonth Formatting

  • 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"
        )
    )
시스템 언어 설정

License

This project is licensed under the MIT License - see the LICENSE file for details.