prolificinteractive / material-calendarview

A Material design back port of Android's CalendarView
https://prolificinteractive.github.io/material-calendarview/
MIT License
5.91k stars 1.32k forks source link
android calendar java material

Material Calendar View

Android Arsenal Travis branch

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.

Demo Screen Capture

Installation

Step 1. Add the JitPack repository to your build file

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

Step 2. Add the dependency

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:

<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"
    />

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:

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

See other changes in the CHANGELOG.

Contributing

Would you like to contribute? Fork us and send a pull request! Be sure to checkout our issues first.

License

Material Calendar View is Copyright (c) 2018 Prolific Interactive. It may be redistributed under the terms specified in the LICENSE file.

Maintainers

prolific

Material Calendar View is maintained and funded by Prolific Interactive. The names and logos are trademarks of Prolific Interactive.