在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):JonasWanke/com.jonaswanke.calendar开源软件地址(OpenSource Url):https://github.com/JonasWanke/com.jonaswanke.calendar开源编程语言(OpenSource Language):Kotlin 98.3%开源软件介绍(OpenSource Introduction):Unfortunately, I no longer have the time to continue developing this library and my focus has shifted. If you are switching to Flutter, you might be interested in my timetable package as a replacement. CalendarViewThis library provides a Material Design CalendarView for Android (week and day view; more coming soon!). The default style is copied from the Google Calendar app, but almost everything is customizable.
Features
Usage
implementation 'com.jonaswanke.calendar:calendar:0.1.1'
<com.jonaswanke.calendar.CalendarView
android:id="@+id/calendar"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:range="week" /> Currently supported ranges are
calendar.eventRequestCallback = { week ->
// Retrieve events synchronously or asynchronously
val events: List<Event> = // ...
calendar.setEventsForWeek(week, events)
}
You can call Events implement the following properties: val title: String // Displayed in bold
val description: String? // Optional; shown in a second line
@get:ColorInt
val color: Int? // Optional background color
val start: Long // Start time
val end: Long // End time
val allDay: Boolean // Whether the event takes all day. If so, start and end are just used to determine the day
calendar.onEventClickListener = { event ->
// Event was clicked
Toast.makeText(this, "${event.title} clicked", Toast.LENGTH_LONG).show()
}
calendar.onEventLongClickListener = { event ->
// Event was long clicked
Toast.makeText(this, "${event.title} long clicked", Toast.LENGTH_LONG).show()
} As shown in screenshot 3 (above), the user can add events by tapping empty space inside calendar.onAddEventListener = { addEvent ->
// User tried to create a new event. addEvent is an event with populated start and end.
Toast.makeText(this, "Add event at ${start}", Toast.LENGTH_SHORT).show()
// Return true to remove the placeholder
true
} SampleThere is also a sample app to get you started. CustomizationFollowing soon... ChangelogSee here for the changelog. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论