Skip to content

mortezasun/android-calendarview

Repository files navigation

https://jitpack.io/#mortezasun/android-calendarview/1.0.0-alpha

📅 Custom CalendarView for Android (ViewBinding)

A powerful and flexible calendar widget for Android applications. Supports multiple views, date range selection, custom styling using ViewBinding, and much more.
You can create any type of calendar you want with this view.

image
image


✨ Features

  • Month, Week, and Day view
  • Single, Multiple, and Range date selection
  • Fully customizable styles (colors, fonts, icons)
  • Localization & custom first day of week
  • Click listeners support
  • Dark mode compatible

📅 Calendar Support

Calendar Support Source
Gregorian (Julian) java.time.LocalDate
java.time.YearMonth
Hijri (Islamic) java.time.chrono.HijrahDate
Solar Hijri
Jalali (Persian)
Jalali Calendar from Mohammad Razeghi

📦 Installation

This library is available on JitPack. Add it to your project in a few simple steps:

Step 1: Add JitPack to your root build.gradle (or settings.gradle for newer Gradle versions)

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

// For Gradle 7.0 and above (settings.gradle.kts)
	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url = uri("https://jitpack.io") }
		}
	}

Step 2: Add the dependency

dependencies {
    implementation 'com.github.mortezasun:calendarview:1.1.0-alpha1'
}

Step 3: Using in Code for Calendar

<com.develotter.calendarview.MultiMonthView
        android:id="@+id/calendar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        />
 var thisCalendarStatus = CalendarStatus()
 binding.calendar.addMonths(GregorianStatus::class.java,object,object :
            MonthSampleAdapter<RowDayBinding, RowWeekBinding, RowMonthBinding, RowShowSelectedDayBinding>(thisCalendarStatus){}

Optional

for Activating Day before show Calendar

  var dayStatusListSelectedBySingleSelect: MutableList<DayStatus> = mutableListOf()
  dayStatusListSelectedBySingleSelect.add(0, object :DayStatus(LocalDate.now(), lcInUse){})
  binding.calendar.addMonths(GregorianStatus::class.java,object,object :
            MonthSampleAdapter<RowCalendarBinding, RowCalendarBinding, RowMonthBinding, RowShowSelectedDayBinding>
                    (thisCalendarStatus,dayStatusListSelectedBySingleSelect=dayStatusListSelectedBySingleSelect ))

About

A powerful and flexible calendar widget for Android applications based of Viewbinding

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages