Git Product home page Git Product logo

compose-calendar-template's Introduction

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!

compose-calendar-template's People

Contributors

lyh990517 avatar

Stargazers

Muhammad Daffa Aldriantama avatar Mwadime avatar Ar Razy Fathan Rabbani avatar Ian Kim avatar  avatar Rocky avatar 안중현 avatar  avatar  avatar 임성우 avatar gunchimssak avatar  avatar

Watchers

 avatar

Forkers

rockystevejobs

compose-calendar-template's Issues

Issue from reddit

Hey, I checked out your compose calendar template https://github.com/lyh990517/Compose-Calendar-Template (got to know about it from a thread on reddit). I tried it and noticed that currently it has quite a few bugs.

  1. You didn't specify text colour for year and month, due to which when user toggles between light and dark mode, sometimes text becomes unreadable. (Clear)
  2. You have used sp and dp for font and view sizes due to which your ui breaks if user's font or display size in mobile settings is large. You can use intuit's sdp and ssp library to fix these.
  3. In readme example the calendar view is wrapped up inside a bottom sheet and so i tried to wrap it up in a bottom sheet and i have to stretch the bottom sheet completely to see the whole calendar view. And if i try to wrap it up inside a dialog box, then the dialog box occupies the whole screen which is bad UX.
  4. There is no flexibility to pick up past dates or future. Eg. I cant pick a date earlier than 28 jan 2024 and after jan 2025.

Attaching a screenshot of the same. Try toggling display and font sizes from your phone's settings since all phones have different dpi hence ui appears different on different phones if you simply use dp.

These are the few things I noticed. Apart from these, it works well for the most part. Hope you don't mind! Cheers.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.