Compose Calendar is a sample calendar component built using Jetpack Compose for Android. It provides a customizable calendar view with various features. I encourage you to ⭐star⭐ this repository if you find it useful!
If you're using Groovy DSL,
//settings.gradle
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
//app.gradle
dependencies {
implementation 'com.github.lyh990517:Compose-Calendar-Template:latest-release'
}
If you're using Kotlin DSL
//settings.gradle.kts
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven(url = "https://jitpack.io")
}
}
//app.gradle.kts
dependencies {
implementation ("com.github.lyh990517:Compose-Calendar-Template:latest-release")
}
To use Compose Calendar in your Android app, follow these steps:
- Add Compose Calendar as a dependency in your project.
- Include the
Calendar
composable in your layout. - Customize the calendar appearance and behavior as needed.
- Handle the
onSelect
callback to respond to date selection events.
You can customize Compose Calendar in various ways, such as changing the colors, specifying the number of months to display, and adjusting the layout. Refer to the documentation and source code for more details on customization options.
Here's an example of how to use Compose Calendar in your Android app:
Calendar { selectedDate ->
// Handle selected date here
Toast.makeText(this, "$selectedDate", Toast.LENGTH_SHORT).show()
}
HorizontalCalendar { selectedDate ->
// Handle selected date here
Toast.makeText(this, "$selectedDate", Toast.LENGTH_SHORT).show()
}
If you have any questions, suggestions, or issues, feel free to reach out to us. You can find our contact information on our GitHub repository.
We appreciate your support and contributions to Compose Calendar!