Skip to content

This Jetpack Compose Calendar sample is very simple to use and can be easily customized.

Notifications You must be signed in to change notification settings

lyh990517/Compose-Calendar-Template

Repository files navigation

Compose Calendar

Overview

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!

Quick Start


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")
}

How to Use

To use Compose Calendar in your Android app, follow these steps:

  1. Add Compose Calendar as a dependency in your project.
  2. Include the Calendar composable in your layout.
  3. Customize the calendar appearance and behavior as needed.
  4. Handle the onSelect callback to respond to date selection events.

Customization

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.

Usage Examples

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()
} 

Contact

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!

About

This Jetpack Compose Calendar sample is very simple to use and can be easily customized.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages