Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
com.prolificinteractive:material-calendarview
Advanced tools
A Material design back port of Android's CalendarView
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.
compile 'com.prolificinteractive:material-calendarview:1.4.3'
to your dependencies.MaterialCalendarView
into your layouts or view hierarchy.OnDateSelectedListener
or call MaterialCalendarView.getSelectedDates()
when you need it.Example:
<com.prolificinteractive.materialcalendarview.MaterialCalendarView
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/calendarView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:mcv_showOtherDates="all"
app:mcv_selectionColor="#00F"
/>
CalendarMode.WEEK
and all week mode functionality is officially marked @Experimental
. All APIs
marked @Experimental
are subject to change quickly and should not be used in production code. They
are allowed for testing and feedback.
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 date. As a result, the same 4 methods called in a different order could result in a different state, which is bad.
For most cases you will simply need to replace setting those invariants with:
mcv.state().edit()
.setFirstDayOfWeek(Calendar.WEDNESDAY)
.setMinimumDate(CalendarDay.from(2016, 4, 3))
.setMaximumDate(CalendarDay.from(2016, 5, 12))
.setCalendarDisplayMode(CalendarMode.WEEKS)
.commit();
mcv.state().edit()
will retain previously set values; mcv.newState()
will create a new state using default values. Calling commit
will trigger the rebuild of adapters and date ranges. It is recommended these state changes occur as the first modification to MCV (before configuring anything else like current date or selected date); we make no guarantee those modifications will be retained when the state is modified.
See CUSTOMIZATION_BUILDER for usage details.
New: setSelectionMode(SELECTION_MODE_RANGE)
was added to allow 2 dates to be selected and have the entire range of dates selected. Much thanks to papageorgiouk for his work on this feature.
See other changes in the CHANGELOG.
getTileSize
is deprecated. Use getTileWidth
or getTileHeight
.goToNext
and goToPrevious
API to programmatically trigger pagingsetAllowClickDaysOutsideCurrentMonth
setTileWidth
and setTileHeight
setContentDescriptionArrowPast
, ArrowFuture
, Calendar
Make sure to check all the documentation available here.
One of the aims of this library is to be customizable. The many options include:
All of this and more can be done via the decorator api. Please check out the decorator documentation.
If you provide custom drawables or colors, you'll want to make sure they respond to state. Check out the documentation for custom states.
Would you like to contribute? Fork us and send a pull request! Be sure to checkout our issues first.
Material Calendar View is Copyright (c) 2016 Prolific Interactive. It may be redistributed under the terms specified in the LICENSE file.
Material Calendar View is maintained and funded by Prolific Interactive. The names and logos are trademarks of Prolific Interactive.
FAQs
A Material design back port of Android's CalendarView
We found that com.prolificinteractive:material-calendarview demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.