📅
Minimal Calendar
This calendar library is built with jetpack compose. Easy, simple, and minimal.
Latest version
The stable version of the library is the version that uses Compose 1.1.x
, and it can be used as follows to cope with the Compose 1.2.x
version.
Compose | Library |
---|---|
1.1.x | |
1.2.x (alpha) |
Setup
Include the following in your app module’s build.gradle(app)
file:
android {
....
compileOptions {
coreLibraryDesugaringEnabled true
}
}
dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:'
}
See here for the
setting.gradle
:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
....
maven { url "https://jitpack.io" }
}
}
build.gradle(app)
:
dependencies {
implementation 'com.github.memeze:minimal-calendar:'
}
See here for the
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.