+0
Daily
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
#270How to get date in decorate(DayViewFacade view)18 comments · 2016-04-15#8View inflation is bit slow when the view is inside of a DialogFragment15 comments · 2015-02-28#917Android Studio 3.3 and gradle plugin 3.3.0 wont compile13 comments · 2019-01-18#876Exception in editor mode (preview not work)13 comments · 2018-09-28#902How to remove decorator for a selected day?12 comments · 2018-11-25#851Enhancement - RTL - Missing support for viewpager reverse sliding 12 comments · 2018-08-15#1075Clarification: Can I able to show the events of a particular day using this calendar11 comments · 2020-11-05#947Compilation error could not find LocalDate10 comments · 2019-04-19
Latest release
2.0.0 2.0.0 2018-09-07Removed - 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.