prolificinteractive /material-calendarview

A Material design back port of Android's CalendarView

★ 5,892⑂ 1,291👁 196⑃ 229● 919▤ 22
下载:2.0.02.0.0 ↓2.0.02018-09-07
+0
日增长
5,892
stars
1,291
forks
196
watchers
229
prs
919
issues
22
releases

README

Material Calendar View 
  

A Material design back port of Android's CalendarView. The goal is to have a Material look
and feel, rather than 100% parity with the platform's implementation.



 Installation

Step 1. Add the JitPack repository to your build file

groovy
allprojects {
  repositories {
    ...
    maven { url 'https://jitpack.io' }
  }
}


Step 2. Add the dependency

groovy
dependencies {
  implementation 'com.github.prolificinteractive:material-calendarview:${version}'
}


 Usage

1. Add MaterialCalendarView into your layouts or view hierarchy.
2. Set a OnDateSelectedListener or call MaterialCalendarView.getSelectedDates() when you need it.

Javadoc Available Here

Example:

xml




 Documentation

Make sure to check all the documentation available here.

 Customization

One of the aims of this library is to be customizable. The many options include:

 Define the view's width and height in terms of tile size
 Single or Multiple date selection, or disabling selection entirely
 Showing dates from other months or those out of range
 Setting the first day of the week
 Show only a range of dates
 Customize the top bar
 Custom labels for the header, weekdays, or individual days


 Events, Highlighting, Custom Selectors, and More!

All of this and more can be done via the decorator api. Please check out the decorator documentation.

 Recent Changes

 Major Change in 2.0

Material CalendarView 2.0 comes in with a major change into the core of it's API, we transitioned from using java.util.Calendar to java.time.LocalDate. Also that should not impact the public api (we are still using CalendarDay), both Calendar and LocalDate function a little bit differently.
One example of that: Months are now indexed from 1 (January) to 12 (December). You can access from the LocalDate from CalendarDay using getDate().

 Major Change in 1.6.0

Also this release doesn't have any break changes, it provides significant improvements to the widget. More customization have been added for the user (custom fonts, long click listener, show/hide weekdays) as well as various fixes, improvements to the sample app, and general cleanup. Make sure to check the CHANGELOG and the release section for more details. 

 Major Change in 1.5.0

We recently updated to the latest gradle and decided to move over our libraries to the hosting service Jitpack.
Please refer to the installation section for more details.

 Major Change in 1.4.0

 Breaking Change: setFirstDayOfWeek, setMin/MaxDate, and setCalendarDisplayMode are moved to a State object. This was necessary because it was unclear that these were not simple setters--individually, they were side effecting and triggered full adapter/date range recalculations. Typical usage of the view involves setting all these invariants up front during onCreate and it was unknown to the user that setting all 4 of these would create a lot of waste. Not to mention certain things were side effecting--some would reset the current day or selected 

Top issues

Latest release

2.0.0 2.0.0 2018-09-07
Removed
- Removed java.util.Calendar in favor of java.time.LocalDate.

 Fixed
- Fixed RTL Support
- Fixed Remove Restored XML Parameters
- Fixed Range selection ordering & Issues
- Fixed Timezone Issues

 Changes:
- Replaced arrows pngs with vectors
- New Api naming for setting the arrows drawable: setLeftArrow and setRightArrow
- Code Style Reformat to Prolific's latest.

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON