Skip to content

Material Calendar view for android api 19+, a fork from blackbox vision, faced some bugs but no one is resolving it so I forked it and solve the problems

License

Notifications You must be signed in to change notification settings

LeeBoonKong/Material-CalendarView

Repository files navigation

> Prettier and simpler Material Design CalendarView

[License: MIT]

MaterialCalendarView is a prettier and simpler, material design calendar that allows full customization and it's backwards compatible with API 19+.

Screenshots

Quick Start

Gradle

  • Add it in your root build.gradle at the end of repositories:
repositories {
	maven { 
	    url "https://jitpack.io"
	}
}
  • Add the dependency:
dependencies {
    implementation 'com.github.LeeBoonKong:Material-CalendarView:1.15'
}

In your layout.xml file:

<com.leeboonkong.materialcalendarview.view.CalendarView
	android:id="@+id/calendar_view"
	android:layout_width="match_parent"
	android:layout_height="wrap_content"
	android:background="@color/colorPrimary">
</com.leeboonkong.materialcalendarview.view.CalendarView>

This example shows all the possible customization around Material Calendar View:

<com.leeboonkong.materialcalendarview.view.CalendarView
	android:id="@+id/calendar_view"
	android:layout_width="match_parent"
	android:layout_height="match_parent"
	app:calendarIsMultiSelectDayEnabled="false"
	app:calendarIsOverflowDatesVisible="true"
	app:calendarBackgroundColor="@color/colorPrimary"
	app:calendarTitleTextColor="@color/colorAccent"
	app:calendarCurrentDayTextColor="@color/white"
	app:calendarDayOfWeekTextColor="@color/grey"
	app:calendarDayOfMonthTextColor="@android:color/white"
	app:calendarDisabledDayBackgroundColor="@color/colorPrimary"
	app:calendarDisabledDayTextColor="@android:color/darker_gray"
	app:calendarSelectedDayBackgroundColor="@color/colorAccent"
	app:calendarTitleBackgroundColor="@color/colorPrimary"
	app:calendarWeekBackgroundColor="@color/colorPrimary"
	app:calendarCurrentDayBackgroundColor="@color/teal500"
	app:calendarWeekendTextColor="@color/colorAccent"
	app:calendarButtonBackgroundColor="@color/colorAccent">
</com.leeboonkong.materialcalendarview.view.CalendarView>

Then, in your Activity.java or Fragment.java initialize the calendar:

calendarView = (CalendarView) findViewById(R.id.calendar_view);

calendarView.shouldAnimateOnEnter(true)
	.setFirstDayOfWeek(Calendar.MONDAY)	
	.setOnDateClickListener(this::onDateClick)
	.setOnMonthChangeListener(this::onMonthChange)
	.setOnDateLongClickListener(this::onDateLongClick)
	.setOnMonthTitleClickListener(this::onMonthTitleClick);

if (calendarView.isMultiSelectDayEnabled()) {
	calendarView.setOnMultipleDaySelectedListener(this::onMultipleDaySelected);
}

calendarView.update(Calendar.getInstance(Locale.getDefault()));

Enjoy your new, beautiful, Materially-Designed calendar!

Issues

If you found a bug, or questions, you can open an issue at this github repository.

Contributing

Of course, if you see something that you want to upgrade from this library, or a bug that needs to be solved, PRs are welcome!
Currently me(LeeBoonKong) is the only one maintaining this repository and fixing bugs, this is an open source project forked from https://github.com/BlackBoxVision/material-calendar-view, but the original was not maintained anymore.
If you would like to contribute you can:

  1. Write documentations for this project.
  2. Fix bugs, add new features and maintain this project.

Your Github username will be included in the Developers and Maintainers section.

Developers and Maintainers(Github username)

LeeBoonKong

License

Distributed under the MIT license. See LICENSE for more information.

About

Material Calendar view for android api 19+, a fork from blackbox vision, faced some bugs but no one is resolving it so I forked it and solve the problems

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 8

Languages