CalendarView
RecyclerView? ListView or ViewGroup? No, it's Canvas! Ultra performance and free customization interface! Vertical and horizontal, Fast rendering and extremely low memory. Android上一个优雅、万能自定义UI、仿iOS、自定义动画,支持垂直、水平方向切换、支持周视图、自定义周起始、性能高效的日历控件,热插拔实现UI定制!Canvas绘制,渲染速度快、占用内存低,你真的想不到日历居然还可以如此优雅。
An Android library for adding a fast, customizable calendar to mobile apps, supports monthly, weekly, and yearly views with custom drawing styles, added via a single Gradle line.
CalendarView is an Android library that provides a highly customizable calendar component for mobile apps. Instead of building the calendar out of Android's standard scrollable list or layout containers, it draws everything directly on a Canvas, which is the low-level drawing surface available in Android. This approach makes it faster to render and lighter on memory than the typical approach.
The library supports both monthly and weekly calendar views, and allows switching between vertical and horizontal scrolling orientations. Developers can subclass the built-in view classes to draw date cells in any visual style they want, since the rendering is done through custom drawing code rather than inflated XML layouts. The repository includes screenshots showing several example styles: a standard grid, a colorful full-screen layout, progress bar indicators on dates, and a Meizu phone-inspired calendar with expanding and collapsing week rows.
Date range selection is also supported, meaning users can tap a start date and an end date to highlight a span of days. A year view is available as well.
The library is added to an Android project through its Gradle dependency line. There are two version lines: one for the older Android Support Library and one for the newer AndroidX framework, with 3.7.1 being the last publicly released AndroidX version. The README notes that some features, including the iOS-style vertical and horizontal switching animation, are no longer open source after version 3.7.1.
Documentation is available in both English and Chinese in the repository. The project is licensed under the Apache License 2.0.
Where it fits
- Add a monthly calendar with custom-styled date cells to your Android app using a single Gradle dependency.
- Implement date range selection so users can tap a start and end date to highlight a span of days for bookings or scheduling.
- Create a weekly calendar view with progress bar indicators on each date to show task completion.