Modern Calendar View Supporting Both Hijri and Gregorian Calendars but in highly dynamic way

Overview

KCalendar-View

Modern calendar view supporting both Hijri and Gregorian calendars but in highly dynamic way

LinkedIn License: MIT JitPack

Features

  • Supporting multi locale mainly [EN, AR]
  • Supporting both [Hijri, Gregorian] calendars
  • Java time used in dates conversion
  • Day view binder
  • Month view binder
  • 100% Kotlin

Getting Started

Instillation

Add the JitPack repository to your project level build.gradle:

allprojects {
 repositories {
    google()
    jcenter()
    maven { url "https://jitpack.io" }
 }
}

Add CalendarView to your app build.gradle:

dependencies {
	implementation 'com.github.nLoops:KCalendar-View:
   
    '
   
}

How to use it

Step One

Adding view to XML with starter attrs

">
        <com.thebluekernel.calendar.library.data.ui.monthlist.KCalendarView
            android:id="@+id/calendarView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:cal_WeekTextStyle="@style/Widget.Calendar.Week.Text"
            app:cal_calendarMaxYear="2022"
            app:cal_calendarMinYear="2021"
            app:cal_calendarStartOfWeek="sunday"
            app:cal_calendarType="gregorian"
            app:cal_dayViewRes="@layout/item_day_layout"
            app:cal_locale="en"
            app:cal_monthViewRes="@layout/item_month_res_layout"
            app:cal_scrollDirection="horizontal" />

Define your item cell xml

">
    <TextView
        android:id="@+id/dayTextView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:gravity="center"
        android:includeFontPadding="false"
        android:padding="4dp"
        android:textAlignment="center"
        android:textAppearance="@style/TextAppearance.MaterialComponents.Subtitle1"
        tools:text="22" />

Define your month header xml

">
    <TextView
        android:id="@+id/tvMonthName"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:gravity="center"
        android:textAlignment="center"
        android:textAppearance="@style/TextAppearance.MaterialComponents.Subtitle1"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toStartOf="@id/btnArrowNext"
        app:layout_constraintStart_toEndOf="@id/btnArrowPrev"
        app:layout_constraintTop_toTopOf="parent"
        tools:text="Nov 2019" />

Step Two

Conform binders contract for both Day and Month

        val dayBinder = object : CalendarDayBinder<DayViewContainer> {
            override fun create(view: View) = DayViewContainer(view)

            override fun bind(holder: DayViewContainer, day: CalendarDay) {
              // handle your logic here
            }

        }
        val monthBinder = object : CalendarMonthBinder<MonthViewContainer> {
            override fun create(view: View) = MonthViewContainer(view)

            override fun bind(holder: MonthViewContainer, month: CalendarMonth) {
              // handle month logic here
            }

        }
  // assign binders to calendar view
  calendarView.dayBinder = dayBinder
  calendarView.monthBinder = monthBinder

You can refer to demo projcet examples for practical usage.

Screenshots

Demo app screenshots

TODO

  • Range date selection.
  • Week row.
  • Multi-date selection.
  • Async setup for better performance especially into big range of dates.

Contribution

Feel free to fork project and do your changes, but don't forget to leave a start _

You might also like...
A set of highly-opinionated, batteries-included gradle plugins to get you started building delicious multi-module Kotlin projects

Sourdough Gradle What is Sourdough Gradle? Sourdough is a set of highly opinionated gradle plugins that aim to act as the starter for your Kotlin proj

Example Multi module architecture Android project using MVVM, Dynamic Features, Dagger-Hilt, Coroutines and Navigation Components
Example Multi module architecture Android project using MVVM, Dynamic Features, Dagger-Hilt, Coroutines and Navigation Components

ModularDynamicFeatureHilt An Android template project following a multi module approach with clean architecture. It has been built following Clean Arc

A declarative, Kotlin-idiomatic API for writing dynamic command line applications.
A declarative, Kotlin-idiomatic API for writing dynamic command line applications.

A declarative, Kotlin-idiomatic API for writing dynamic command line applications.

An app to demonstrate Apple's new feature dynamic island in Android with Jetpack Compose
An app to demonstrate Apple's new feature dynamic island in Android with Jetpack Compose

Jet Island Dynamic Island in Android with Jetpack Compose An app to demonstrate Apple's new feature dynamic island in Android with Jetpack Compose. Th

Workout Journal is a mobile app based on Multi-Module and Clean Architecture for those who want to track their progress over a workout and a calendar period.
Workout Journal is a mobile app based on Multi-Module and Clean Architecture for those who want to track their progress over a workout and a calendar period.

Workout-Journal Workout Journal is a mobile app for those who want to track their progress over a workout and a calendar period. The app allows you to

🔎 An HTTP inspector for Android & OkHTTP (like Charles but on device) - More Chucker than Chuck
🔎 An HTTP inspector for Android & OkHTTP (like Charles but on device) - More Chucker than Chuck

Chucker A fork of Chuck Getting Started Features Multi-Window Configure Redact-Header️ Decode-Body Migrating Snapshots FAQ Contributing Building Ackno

MyAndroidTools, but powered by Sui
MyAndroidTools, but powered by Sui

MyAndroidTools 便捷地管理您的 Android 设备 简介 与另一款 MyAndroidTools 一样,本应用使你能够便捷地管理 Android 设备中的应用和组件。但与之不同的是,本应用通过 Sui 来调用高权限 API,所以不会在使用过程中频繁弹出 root 授权的 Toast

A beautiful material calendar with endless scroll, range selection and a lot more!
A beautiful material calendar with endless scroll, range selection and a lot more!

CrunchyCalendar A light, powerful and easy to use Calendar Widget with a number out of the box features: Infinite vertical scrolling in both direction

Android calendar library provides easy to use widget with events
Android calendar library provides easy to use widget with events

Kotlin-AgendaCalendarView Kotlin-AgendaCalendarView based on AgendaCalendarView Kotlin-AgendaCalendarView is a awesome calendar widget with a list of

Releases(1.0.0-alpha14)
Owner
Ahmed Ibrahim
Mobile Technical Lead [ Android | iOS | Flutter ]
Ahmed Ibrahim
A highly customizable calendar library for Android, powered by RecyclerView.

CalendarView A highly customizable calendar library for Android, powered by RecyclerView. With this library, your calendar will look however you want

Kizito Nwose 3.4k Jan 3, 2023
Same as an Outlined text fields presented in Material Design page but with some dynamic changes

README SSCustomEditTextOutlineBorder Getting Started SSCustomEditTextOutLineBorder is a small kotlin library for android to support outlined (stroked)

Simform Solutions 194 Dec 30, 2022
A library for creating dynamic skeleton view

Skeleton Placeholder View Overview A Library designed to draw a Skeleton by "skinning" the view from a provided layout. Skeleton is composed of Bone w

Ferry Irawan 25 Jul 20, 2021
LiveData 数据倒灌:别问,问就是不可预期 - Perfect alternative to SingleLiveEvent, supporting multiple observers.

前言 大家好,我是《Jetpack MVVM Best Practice》作者 KunMinX。 今天提到的 “数据倒灌” 一词,缘于我为了方便理解和记忆 “页面在 ‘二进宫’ 时收到旧数据推送” 的情况,而在 2019 年 自创并在网上传播的 关于此类现象的概括。 它主要发生在:通过 Shared

KunMinX 924 Jan 5, 2023
A template that utilizes both Scala and Kotlin because why not (And also because I endorse programming hell)

Fabric-Scala-Kotlin-template A template that utilizes both Scala and Kotlin because why not (And also because I endorse programming hell) I don't care

null 1 Dec 25, 2021
Android Spinner Dialog Library supported on both Java and Kotlin, Use for single or multi selection of choice

SpinnerDialog Android Spinner Dialog Library, Use for single or multi selection of choice Android UI Download To include SpinnerDialog in your project

Hamza Khan 55 Sep 15, 2022
A mindustry mod that shuffles both the texture atlas and bundle

ohno amogus Total chaos Mindustry mod that shuffles both the texture atlas and the current bundle, providing an unforgettable gaming experience Comes

Мнемотехник 4 Sep 3, 2022
Kotlin Multiplatform is an SDK for cross-platform mobile development, which enables teams to use the same business logic in both Android and iOS client applications.

Kotlin Multiplatform is an SDK for cross-platform mobile development, which enables teams to use the same business logic in both Android and iOS client applications.

Chris Russell 1 Feb 11, 2022
A tool that can mock out an existing Appium session, supports both Java and Kotlin.

appium-mocker A tool that can mock out an existing Appium session, supports both Java and Kotlin. How to install latest appium-mocker Beta/Snapshots <

aaronLLL 21 Jun 8, 2022
:closed_umbrella: An easy way to implement modern permission instructions popup.

Needs An easy way to implement modern permission instructions popup. Needs can be fully customized and showing with animations. Download Gradle Add be

Jaewoong Eum 609 Dec 8, 2022