explaingit

huanghaibin-dev/calendarview

9,373JavaAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

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.

Mindmap

mindmap
  root((CalendarView))
    Views
      Monthly grid
      Weekly strip
      Year overview
    Features
      Date range select
      Custom cell drawing
      Vertical scrolling
    Setup
      Gradle dependency
      AndroidX support
    Limits
      Some features closed
      After v3.7.1
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Add a monthly calendar with custom-styled date cells to your Android app using a single Gradle dependency.

USE CASE 2

Implement date range selection so users can tap a start and end date to highlight a span of days for bookings or scheduling.

USE CASE 3

Create a weekly calendar view with progress bar indicators on each date to show task completion.

Tech stack

JavaAndroidGradleCanvas

Getting it running

Difficulty · easy Time to first run · 30min

Features introduced after version 3.7.1 are no longer open source.

Use freely in personal and commercial projects under the Apache License 2.0 with attribution.

In plain English

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.

Copy-paste prompts

Prompt 1
Add CalendarView 3.7.1 to my AndroidX project, extend MonthView to draw a colored dot on dates that have events, and set up the date selection callback.
Prompt 2
I need date range selection in my Android booking app. Show me the CalendarView setup code that highlights all days between two tapped dates.
Prompt 3
How do I let users switch CalendarView between monthly and weekly modes with a tap on the week row header?
Open on GitHub → Explain another repo

← huanghaibin-dev on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.