Fully customizable Calendar/DatePicker for Android/Kotlin

Overview

Header

License

AMCalendar - Android Date (Range) Picker

AMCalendar is a fully customisable widget for picking dates and ranges based on the native Calendar.

It's an Android port of the Fastis iOS Calendar Framework by Simla.Tech build from scratch.

Features

  • Flexible customization
  • Shortcuts for dates and ranges
  • Single date and date range modes

Installation

Add this to your root gradle:

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

Add this to your module's gradle dependencies:

dependencies {
    implementation 'com.github.appmonkey8010:amcalendar:[RELEASE]' //e.g.: 1.0.0
}

Usage

Quick Start

import at.appmonkey.amcalendar.base.AMCalendar

class MainActivity : AppCompatActivity() {

    AMCalendar.rangeSelect(this, object : RangeSelectionListener {
            override fun onRangeSelect(cal1: Calendar?, cal2: Calendar?) {
                ...
            }
        }).shortcuts(TodayRangeShortcut(this), LastWeekRangeShortcut(this))
            .show()

}

Single and range modes

If you want to get a single date, you have to use the SingleAMCalendar implementation:

AMCalendar.singleSelect(this, object : SingleSelectionListener {
    override fun onSingleSelect(cal: Calendar?) {
        if(cal != null) {
            Log.v("AMCalendar", cal.toString())
        }
    }
}).preselect(Calendar.getInstance())
    .show()

If you want to get a date range, you have to use the RangeAMCalendar implementation:

AMCalendar.rangeSelect(this, object : RangeSelectionListener {
    override fun onRangeSelect(cal1: Calendar?, cal2: Calendar?) {
        if(cal1 != null && cal2 != null) {
            Log.v("AMCalendar", cal1.toString())
            Log.v("AMCalendar", cal2.toString())
        }
    }
}).preselect(Calendar.getInstance(), Calendar.getInstance())
    .show()

Configuration

  • shortcuts- Shortcuts array. The default value is null. See Shortcuts section
  • preselect- An initial value which will be selected by default. The default value is null.

Shortcuts

Using shortcuts allows you to select set dates or date ranges quickly. By default shortcuts is null. The bottom container will be hidden if you don't provide any shortcuts.

In AMCalendar available some prepared shortcuts for each mode:

  • For SingleAMCalendar: TodaySingleShortcut, TomorrowSingleShortcut, YesterdaySingleShortcut
  • For RangeAMCalendar: TodayRangeShortcut, LastWeekRangeShortcut, LastMonthRangeShortcut

Also, you can create your own shortcut:

class CustomRangeShortcut : AMCalendarRangeShortcut() {

  init {
    cal1 = Calendar.getInstance()
    cal2 = null
    text = "Today"
  }

}
AMCalendar.rangeSelect(...)
    .shortcuts(CustomRangeShortcut(), LastWeekRangeShortcut(context))

Customization

AMCalendar's appearance can be customized with resources. Following keys can be overridden:

<!-- colors.xml -->
<color name="colorAMCalendarBackground">#ffffff</color>
<color name="colorAMCalendarCancel">#3c72d1</color>
<color name="colorAMCalendarSelect">#3c72d1</color>
<color name="colorAMCalendarDisabled">#bebebe</color>
<color name="colorAMCalendarHeaderDisabled">#bebebe</color>
<color name="colorAMCalendarHeaderSelected">#000000</color>
<color name="colorAMCalendarHeaderClear">#4b4b4b</color>
<color name="colorAMCalendarWeekday">#000000</color>
<color name="colorAMCalendarWeekdayBackground">#f0f0f6</color>
<color name="colorAMCalendarMonth">#3c72d1</color>
<color name="colorAMCalendarDay">#000000</color>
<color name="colorAMCalendarDaySelected">#FFFFFF</color>
<color name="colorAMCalendarDaySelectedCircle">#3c72d1</color>
<color name="colorAMCalendarShortcutBackground">#f0f0f6</color>
<color name="colorAMCalendarShortcutElementBackground">#FFFFFF</color>
<color name="colorAMCalendarShortcutElementText">#000000</color>

By default the library provides a light and a dark theme.

<!-- strings.xml -->
<string name="amcalendar_select">Select</string>
<string name="amcalendar_please_select_date">Please select date</string>
<string name="amcalendar_please_select_date_range">Please select date range</string>
<string name="amcalendar_template_today">Today</string>
<string name="amcalendar_template_tomorrow">Tomorrow</string>
<string name="amcalendar_template_yesterday">Yesterday</string>
<string name="amcalendar_template_last_week">Last week</string>
<string name="amcalendar_template_last_month">Last month</string>
<string name="amcalendar_monday_short">MON</string>
<string name="amcalendar_tuesday_short">TUE</string>
<string name="amcalendar_wednesday_short">WED</string>
<string name="amcalendar_thursday_short">THU</string>
<string name="amcalendar_friday_short">FRI</string>
<string name="amcalendar_saturday_short">SAT</string>
<string name="amcalendar_sunday_short">SUN</string>

By default the library provides following languages:

  • English (default)
  • German
Donate with PayPal

License

AMCalendar is released under the MIT license. See LICENSE for details.

You might also like...
📅 Material Design Calendar compatible with API 11+
📅 Material Design Calendar compatible with API 11+

Prettier and simpler Material Design CalendarView MaterialCalendarView is a prettier and simpler, material design calendar that allows full customiz

📅 Material Design Calendar compatible with API 11+
📅 Material Design Calendar compatible with API 11+

Prettier and simpler Material Design CalendarView MaterialCalendarView is a prettier and simpler, material design calendar that allows full customiz

A TimelineView that will help you create event timelines in apps just like the Google Calendar DayView
A TimelineView that will help you create event timelines in apps just like the Google Calendar DayView

TimelineView A TimelineView that will help you create event timelines in apps just like the Google Calendar DayView A library that allows you to creat

JetCalendarView - A calendar library for Jetpack Compose
JetCalendarView - A calendar library for Jetpack Compose

JetCalendar WIP 2022 Hit Refresh! Calendar view ❤️ Jetpack Compose License Copyr

A customizable, easy-to-use, and functional circular time range picker library for Android
A customizable, easy-to-use, and functional circular time range picker library for Android

A customizable, easy-to-use, and functional circular time range picker library for Android. Use this library to mimic Apple's iOS or Samsung's bedtime picker.

A date time range picker for android written in Kotlin
A date time range picker for android written in Kotlin

DateTimeRangePicker A date time range picker for android Usage Firstly, grab latest release of the library via JitPack. And note that, it utilizes Jod

Android interval timer app using compose + compose navigation, dagger hilt,  room, kotlin coroutines + flow and mvvm design pattern.
Android interval timer app using compose + compose navigation, dagger hilt, room, kotlin coroutines + flow and mvvm design pattern.

What's InTime? ⏳ InTime is an interval timer application using android jetpack components and a long running service. The purpose of this project is t

Android Week View is an android library to display calendars (week view or day view) within the app. It supports custom styling.
Android Week View is an android library to display calendars (week view or day view) within the app. It supports custom styling.

Android Week View Android Week View is an android library to display calendars (week view or day view) within the app. It supports custom styling. Fea

A Material design back port of Android's CalendarView
A Material design back port of Android's CalendarView

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 wi

Releases(1.0.0)
Time-DatePicker - A Simple Time Date Picker With Kotlin

Time-DatePicker Time.DatePicker.mp4

Faysal Hossain 0 Jan 19, 2022
An alternative DatePicker for Android

Copyright (C) 2011 Daniel Berndt - Codeus Ltd - DateSlider 1.1 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this

Ben Demboski 240 Nov 25, 2022
Android DatePicker with month and year build with Compose UI

Compose Date Picker - Select month and year Compose Date Picker tries to offer you the year and month pickers which you can customize for your require

Doğuş Teknoloji 48 Jan 7, 2023
A lightweight monthly calendar view for Android, fully written in Kotlin. Designed to meet the minimum demands for typical calendars.

Light Calendar View A lightweight monthly calendar view for Android, fully written in Kotlin. Designed to meet the minimum demands for typical calenda

Recruit Marketing Partners Co.,Ltd 444 Dec 9, 2022
Kalendar - A calendar to integrate Calendar with Custom design in your jetpack compose project

Kalendar - An Elementary Compose Calendar. This is a calendar to integrate Calen

Himanshu Singh 494 Jan 2, 2023
Standalone Android widget for picking a single date from a calendar view.

TimesSquare for Android Standalone Android widget for picking a single date from a calendar view. Usage Include CalendarPickerView in your layout XML.

Square 4.4k Dec 20, 2022
A better calendar for Android

Caldroid Caldroid is a fragment that display calendar with dates in a month. Caldroid can be used as embedded fragment, or as dialog fragment. User ca

Roomorama 1.4k Jan 5, 2023
An android library which provides a compact calendar view much like the one used in google calenders.

CompactCalendarView CompactCalendarView is a simple calendar view which provides scrolling between months. It's based on Java's Date and Calendar clas

SundeepK 1.5k Dec 9, 2022
Android calendar view (like card)

android-calendar-card (Google Play Demo) Android calendar view (like card) Simple and easy to modify Author: Michał Szwarc #CalendarCardPager License

Michał Szwarc 473 Nov 10, 2022
CalEF (Calendar Entry Formatter) : Select an entry in Android-Kalender and send/share the entry's content as human readable text.

CalEF (Calendar Entry Formatter) Select an entry in Android-Kalender and send/share the entry's content as human readable text. Usually calendar entri

k3b 6 Aug 17, 2022