Skip to content

memeze/minimal-calendar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

71 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“… Minimal Calendar

This calendar library is built with jetpack compose. Easy, simple, and minimal.

API GitHub Repo stars

Latest version

The stable version of the library uses Compose 1.2.x version.

Compose Library
1.2.x

Setup

πŸ‘‰ Step.1 Java 8+ API desugaring support (Android Gradle Plugin 4.0.0+).
Include the following in your app module’s build.gradle(app) file:

android {
    ....
    compileOptions {
        coreLibraryDesugaringEnabled true
    }
}

dependencies {
    coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:<latest-version>'
}

See here for the <latest-version>


πŸ‘‰ Step.2 Add it in your setting.gradle:

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        ....
        maven { url "https://jitpack.io" }
    }
}

πŸ‘‰ Step.3 Add the dependency your build.gradle(app):

dependencies {
    implementation 'com.github.memeze:minimal-calendar:<latest-version>'
}

See here for the <latest-version>


Usage

calendar

fun MinimalCalendar(
    modifier: Modifier = Modifier,
    initDate: LocalDate = LocalDate.now(),
    onSelectDate: (date: LocalDate) -> Unit,
    calendarColors: MinimalCalendarColors = MinimalCalendarTheme.colors(),
    calendarConfig: MinimalCalendarConfig = MinimalCalendarConfig()
)

colors

data class MinimalCalendarColors(
    val defaultColor: Color,
    val backgroundColor: Color,
    val headerBackgroundColor: Color,
    val headerDateTextColor: Color,
    val headerTodayIconColor: Color,
    val headerArrowIconColor: Color,
    val headerSelectIconColor: Color,
    val selectionBackgroundColor: Color,
    val selectionItemTextColor: Color,
    val selectionItemSelectedBackgroundColor: Color,
    val selectionItemSelectedTextColor: Color,
    val selectionButtonBackgroundColor: Color,
    val selectionButtonTextColor: Color,
    val weekBackgroundColor: Color,
    val weekTextColor: Color,
    val dateTextColor: Color,
    val dateTodayBackgroundColor: Color,
    val dateTodayTextColor: Color,
    val dateSelectedBackgroundColor: Color,
    val dateSelectedTextColor: Color
)

config

data class MinimalCalendarConfig(
    val yearRange: IntRange = IntRange(1900, 2100),
    val locale: Locale = Locale.getDefault()
)

License

 Copyright 2022 memeze

 Licensed under the Apache License, Version 2.0 (the "License")
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.

About

πŸ—“ A simple calendar library for Android.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages