Calendar - A component for compose desktop

Related tags

Date & Time calendar
Overview

日历

一个用于compose-desktop的日历组件。

截图

image image image image

feature

  • DayPicker的动画
  • 月份选择器错误提示
  • 点击非本月的时间会跳到上个月

todo

  • 年月份的滚动选择

使用

日历选择器目前有分为两部分:DayPicker 和 MonthPicker

CalendarState

保存日历显示时间和选择的时间。

DayPicker

fun DayPicker(
    modifier: Modifier = Modifier,
    state: CalendarState,
    fromSunday: Boolean = true, // 每周是否从周日开始
    contentColor: Color,
    primaryColor: Color,
    hoverColor: Color,
    content: @Composable DayPickerScope.() -> Unit
) 

DayPickerScope

可以在content中获取下面的信息

interface DayPickerScope {
    val isSelected: Boolean
    val isHover: Boolean
    val date: LocalDate
}

例子

DayPicker(
            state = state,
            contentColor = Color.Black,
            primaryColor = Color(0xFFFEA52C),
            hoverColor = Color(0xFFE3E3E3),
        ){
            Text(
                text = "${date.dayOfMonth}", style = androidx.compose.ui.text.TextStyle(
                    fontWeight = FontWeight(600),
                    fontSize = 18.sp,
                ),
                modifier = Modifier.height(30.dp)
            )
            Text(text = "${date.month}")
        }

MonthPicker

fun MonthPicker(
    modifier: Modifier = Modifier,
    state: CalendarState,
    contentColor: Color,
    primaryColor: Color,
    hoverColor: Color,
    errorColor: Color,
) 

使用这个例子

    val state:CalendarState = rememberCalendarState()

    Column {
        MonthPicker(
            state = state,
            contentColor = Color.Black,
            primaryColor = Color(0xFFFEA52C),
            hoverColor = Color(0xFFE3E3E3),
            errorColor = Color(0xFFFF6175),
        )
        DayPicker(
            state = state,
            contentColor = Color.Black,
            primaryColor = Color(0xFFFEA52C),
            hoverColor = Color(0xFFE3E3E3),
        ){
            Text(
                text = "${date.dayOfMonth}", style = androidx.compose.ui.text.TextStyle(
                    fontWeight = FontWeight(600),
                    fontSize = 18.sp,
                ),
                modifier = Modifier.height(30.dp)
            )
            Text(text = "${date.month}")
        }
    }
You might also like...
Solutions for Muetzilla's Advent Calendar

Solutions for Muetzilla's Advent Calendar Link To the Advents Calendar Content Solutions for Muetzilla's Advent Calendar Content Problem 1 Problem 2 P

Kmpcalendar - A calendar library and views written for kotlin multiplatform
Kmpcalendar - A calendar library and views written for kotlin multiplatform

KMPCalendarView Minimal Kotlin Multiplatform project with SwiftUI, Jetpack Compo

An Android platform component management tool chain, based on Kotlin language.
An Android platform component management tool chain, based on Kotlin language.

Rubik Rubik是一套解决Android平台组件化的综合方案,提供gradle project之间的路由通讯能力,以及对gradle project的组件定义、版本控制、maven发布、aar/jar与源码之间的切换以及组件的自由组合等能力。 Rubik由两部分组成: Rubik Router

A kitchen timer implemented with Jetpack Compose
A kitchen timer implemented with Jetpack Compose

Kitchen Timer Motivation and Context To commemorate Jetpack Compose first beta release, Google launched the #AndroidDevChallenge. In the 2nd round, co

Clock of Clocks written in Jetpack Compose framework
Clock of Clocks written in Jetpack Compose framework

A Clock of Clocks made with Jetpack Compose You can download the APK Here. This project is inspired by A Clock of Clocks. Other Implementations This p

 Compose Date Picker - Select month and year
Compose Date Picker - Select month and year

Android DatePicker with month and year build with Compose UI

GoogleCalendar Android Clone with Compose
GoogleCalendar Android Clone with Compose

GoogleCalendar Android Clone with Compose Status: WIP This is a jetpack compose sample app written in Kotlin following clean architecture principles.

Android calendar view inspired by Sunrise calendar and iOS7 stock calendar
Android calendar view inspired by Sunrise calendar and iOS7 stock calendar

SilkCal Android calendar view inspired by Sunrise calendar and iOS7 stock calendar. Usage Add compile 'me.nlmartian.silkcal:library:0.1.1' to your dep

Android calendar view inspired by Sunrise calendar and iOS7 stock calendar
Android calendar view inspired by Sunrise calendar and iOS7 stock calendar

SilkCal Android calendar view inspired by Sunrise calendar and iOS7 stock calendar. Usage Add compile 'me.nlmartian.silkcal:library:0.1.1' to your dep

Calendar - A component for compose desktop
Calendar - A component for compose desktop

日历 一个用于compose-desktop的日历组件。 截图 feature DayPicker的动画 月份选择器错误提示 点击非本月的时间会跳到上个月 to

Briar-desktop - A desktop program for Briar, bringing secure messaging to your desktop and mobile devices

Briar Desktop A desktop program for Briar, bringing secure messaging to your des

Kalendar - A calendar to integrate Calendar with Custom design in your jetpack compose project
Kalendar - A calendar to integrate Calendar with Custom design in your jetpack compose project

Kalendar - An Elementary Compose Calendar. This is a calendar to integrate Calen

📅 Minimal Calendar - This calendar library is built with jetpack compose. Easy, simple, and minimal.
📅 Minimal Calendar - This calendar library is built with jetpack compose. Easy, simple, and minimal.

📅 Minimal Calendar This calendar library is built with jetpack compose. Easy, simple, and minimal. Latest version The stable version of the library i

A Jetpack Compose library for handling calendar component rendering.
A Jetpack Compose library for handling calendar component rendering.

Compose Calendar Compose Calendar is a composable handling all complexity of rendering calendar component and date selection. Due to flexibility provi

The CustomCalendarView provides an easy and customizable calendar to create a Calendar. It dispaly the days of a month in a grid layout and allows to navigate between months

Custom-Calendar-View To use the CustomCalendarView in your application, you first need to add the library to your application. You can do this by eith

Test-compose-for-desktop - Hello World in Compose for Desktop

Testing Run from command line: ./gradlew run Regular build: ./gradlew packageUb

Snake-compose-for-desktop - Snake Game - implemented using Compose for Desktop
Snake-compose-for-desktop - Snake Game - implemented using Compose for Desktop

A Snake game, built with Compose for Desktop snake-compose-for-desktop is my imp

A simple, highly customizable compose navigation component for Android & Desktop platform.
A simple, highly customizable compose navigation component for Android & Desktop platform.

介绍 一个简单并提供高度扩展功能的 Compose 导航组件,同时支持 Android 和 Desktop 平台。 常用功能 使用 下载 // Android implementation("io.github.succlz123:compose-screen-android:0.0.1") //

A desktop code editor app using Jetpack Compose for Desktop and IntelliJ Platform
A desktop code editor app using Jetpack Compose for Desktop and IntelliJ Platform

Compose Code Editor A desktop code editor app using Jetpack Compose for Desktop and IntelliJ Platform. Project Structure The code is contained in the

Owner
wwalkingg
Kotlin
wwalkingg
📅 Minimal Calendar - This calendar library is built with jetpack compose. Easy, simple, and minimal.

?? Minimal Calendar This calendar library is built with jetpack compose. Easy, simple, and minimal. Latest version The stable version of the library i

Minjae Kim 16 Sep 14, 2022
A Jetpack Compose library for handling calendar component rendering.

Compose Calendar Compose Calendar is a composable handling all complexity of rendering calendar component and date selection. Due to flexibility provi

Bogusz Pawłowski 181 Dec 22, 2022
A better calendar for Android

Caldroid Caldroid is a fragment that display calendar with dates in a month. Caldroid can be used as embedded fragment, or as dialog fragment. User ca

Roomorama 1.4k Nov 29, 2022
Standalone Android widget for picking a single date from a calendar view.

TimesSquare for Android Standalone Android widget for picking a single date from a calendar view. Usage Include CalendarPickerView in your layout XML.

Square 4.4k Dec 20, 2022
An android library which provides a compact calendar view much like the one used in google calenders.

CompactCalendarView CompactCalendarView is a simple calendar view which provides scrolling between months. It's based on Java's Date and Calendar clas

SundeepK 1.5k Jan 7, 2023
📅 CosmoCalendar is a fully customizable calendar with a wide variety of features and displaying modes.

CosmoCalendar Made by Applikey Solutions Usage Customization Common Selection Current day Navigation buttons Weekend days Connected days Disabled days

Applikey Solutions 1.6k Dec 22, 2022
CustomizableCalendar is a library that allows you to create your calendar, customizing UI and behaviour

CustomizableCalendar This library allows you to create a completely customizable calendar. You can use CustomizableCalendar to create your calendar, c

MOLO17 216 Dec 6, 2022
Demo app for a horizontal schedule(event) calendar

This is a demo project that showcases a horizontally laid out calendar that shows events in a timeline fashion. It is not a library, just a reference implementation for curious developers.

Halil Ozercan 188 Dec 26, 2022
Android open source calendar

Etar Calendar Etar (from Arabic: إِيتَار) is an open source material designed calendar made for everyone! Why? Well, I wanted a simple, material desig

null 1.5k Jan 4, 2023
A simple calendar with events, customizable widgets and no ads.

Simple Calendar A simple calendar with events and a customizable widget. A simple calendar with optional CalDAV synchronization. You can easily create

Simple Mobile Tools 3k Jan 4, 2023