The CustomCalendarView provides an easy and customizable calendar to create a Calendar. It dispaly the days of a month in a grid layout and allows to navigate between months

Overview

Custom-Calendar-View

To use the CustomCalendarView in your application, you first need to add the library to your application. You can do this by either from Gradle, Maven or by directly downloading the source code form GitHub.

If you enjoy this library, don’t forget to follow me on Twitter @npanigrahy or visit my blog.

Features

Currently it supports the following features:

  • Next and previous month navigation
  • Allow various customization including background color for day, week and title
  • Set custom typeface using setCustomTypeFace() method.
  • Show hide next previous month overflow days
  • Set custom day options for start day of week. By default it is set to Calendar.SUNDAY
  • Unlimited customizations for day of the month using custom Decorators.
  • Allow you to handle event when user changes month and day selection.

alt text

Gradle

Step 1 Add the JitPack repository to your build file. Add it in your build.gradle at the end of repositories.

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

Step-2 Add the dependency in the form

dependencies {
    compile 'com.github.npanigrahy:Custom-Calendar-View:v1.0'
}

Maven

<repository>
     <id>jitpack.io</id>
     <url>https://jitpack.io</url>
</repository>

Step 2 Add the dependency in the form

<dependency>
     <groupId>com.github.npanigrahy</groupId>
     <artifactId>Custom-Calendar-View</artifactId>
     <version>v1.0</version>
</dependency>

Sbt

Step-1 Add it in your build.sbt at the end of resolvers:

resolvers += "jitpack" at "https://jitpack.io"

Step-2 Add the dependency in the form

libraryDependencies += "com.github.npanigrahy" % "Custom-Calendar-View" % "v1.0"

Using CustomCalendarView Library

The GitHub project source includes a sample application, that is used for demonstrating the various features currently supported by this library. Once the library is added to your project, you can include the CustomCalendarView into your activity/fragment layout using the following code snippets.

<com.stacktips.view.CustomCalendarView
	android:id="@+id/calendar_view"
	android:layout_width="match_parent"
	android:layout_height="wrap_content"
	android:background="#ffffff">
</com.stacktips.view.CustomCalendarView>

The above code snippet will show the simple Calendar View with default design. Now, you can use the following attributes, to customize the appearance of calendar.

<com.stacktips.view.CustomCalendarView
        android:id="@+id/calendar_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/off_white"
        app:calendarBackgroundColor="@color/off_white"
        app:calendarTitleTextColor="@color/black"
        app:currentDayOfMonthColor="@color/blue"
        app:dayOfMonthTextColor="@color/black"
        app:dayOfWeekTextColor="@color/black"
        app:disabledDayBackgroundColor="@color/off_white"
        app:disabledDayTextColor="@color/grey"
        app:selectedDayBackgroundColor="@color/blue"
        app:titleLayoutBackgroundColor="@color/white"
        app:weekLayoutBackgroundColor="@color/white">
</com.stacktips.view.CustomCalendarView>

Let us now, initialize the calendar view to control the various other appearance and behavior of calendar using the following methods.

//Initialize CustomCalendarView from layout
calendarView = (CustomCalendarView) findViewById(R.id.calendar_view);

//Initialize calendar with date
Calendar currentCalendar = Calendar.getInstance(Locale.getDefault());

//Show Monday as first date of week
calendarView.setFirstDayOfWeek(Calendar.MONDAY);

//Show/hide overflow days of a month
calendarView.setShowOverflowDate(false);

//call refreshCalendar to update calendar the view
calendarView.refreshCalendar(currentCalendar);

//Handling custom calendar events
calendarView.setCalendarListener(new CalendarListener() {
    @Override
    public void onDateSelected(Date date) {
        SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy");
        Toast.makeText(MainActivity.this, df.format(date), Toast.LENGTH_SHORT).show();
    }

    @Override
    public void onMonthChanged(Date date) {
        SimpleDateFormat df = new SimpleDateFormat("MM-yyyy");
        Toast.makeText(MainActivity.this, df.format(date), Toast.LENGTH_SHORT).show();
    }
});

Using Custom TypeFace

//Setting custom font
final Typeface typeface = Typeface.createFromAsset(getAssets(), "fonts/Arch_Rival_Bold.ttf");
if (null != typeface) {
    calendarView.setCustomTypeface(typeface);
    calendarView.refreshCalendar(currentCalendar);
}

Custom Calendar View Library in Android Custom Font

Using Day Decorators

//adding calendar day decorators
List decorators = new ArrayList<>();
decorators.add(new ColorDecorator());
calendarView.setDecorators(decorators);
calendarView.refreshCalendar(currentCalendar);
Custom Calendar View Library in Android Decorator

License

/*
 * Copyright (C) 2015 Stacktips {link: http://stacktips.com}.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
Comments
  • Getting Could not resolve com.github.npanigrahy:Custom-Calendar-View:v1.0. error

    Getting Could not resolve com.github.npanigrahy:Custom-Calendar-View:v1.0. error

    Hi @npanigrahy

    I need some help for integrating library. I'm getting following error while compiling android project: Could not resolve com.github.npanigrahy:Custom-Calendar-View:v1.0.

    Following is detailed files:

    Top-level build.gradle

    // Top-level build file where you can add configuration options common to all sub-projects/modules.
    
    buildscript {
        repositories {
            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:2.2.0'
    
            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        }
    }
    
    allprojects {
        repositories {
            jcenter()
            maven { url "https://jitpack.io" }
        }
    }
    
    task clean(type: Delete) {
        delete rootProject.buildDir
    }
    
    

    project build.gradle

    apply plugin: 'com.android.application'
    
    android {
        compileSdkVersion 24
        buildToolsVersion '24.0.1'
    
        defaultConfig {
            applicationId "com.test.test"
            minSdkVersion 16
            targetSdkVersion 23
            versionCode 1
            versionName "1.0"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    }
    
    dependencies {
        compile fileTree(include: ['*.jar'], dir: 'libs')
        testCompile 'junit:junit:4.12'
        compile 'com.github.npanigrahy:Custom-Calendar-View:v1.0'
    
        compile 'com.android.support:appcompat-v7:24.2.1'
        compile 'com.android.support:cardview-v7:24.2.1'
        compile 'com.android.support:design:24.2.1'
        compile 'com.android.support:support-v4:24.2.1'
        compile 'com.android.support:recyclerview-v7:24.+'
    }
    

    stack trace Error:A problem occurred configuring project ':app'.

    Could not resolve all dependencies for configuration ':app:_debugApkCopy'. Could not resolve com.github.npanigrahy:Custom-Calendar-View:v1.0. Required by: STYYLE:app:unspecified > Could not resolve com.github.npanigrahy:Custom-Calendar-View:v1.0. > Could not get resource 'https://jcenter.bintray.com/com/github/npanigrahy/Custom-Calendar-View/v1.0/Custom-Calendar-View-v1.0.pom'. > Could not GET 'https://jcenter.bintray.com/com/github/npanigrahy/Custom-Calendar-View/v1.0/Custom-Calendar-View-v1.0.pom'. > RSA premaster secret error > Could not resolve com.github.npanigrahy:Custom-Calendar-View:v1.0. > Could not get resource 'https://repo1.maven.org/maven2/com/github/npanigrahy/Custom-Calendar-View/v1.0/Custom-Calendar-View-v1.0.pom'. > Could not GET 'https://repo1.maven.org/maven2/com/github/npanigrahy/Custom-Calendar-View/v1.0/Custom-Calendar-View-v1.0.pom'. > RSA premaster secret error > Could not resolve com.github.npanigrahy:Custom-Calendar-View:v1.0. > Could not get resource 'https://jitpack.io/com/github/npanigrahy/Custom-Calendar-View/v1.0/Custom-Calendar-View-v1.0.pom'. > Could not GET 'https://jitpack.io/com/github/npanigrahy/Custom-Calendar-View/v1.0/Custom-Calendar-View-v1.0.pom'. > RSA premaster secret error

    Thanks in advance.

    opened by shraddhasd 4
  • After day selection, the decorator disappears

    After day selection, the decorator disappears

    After setting DayDecorators on a CustomCalendar, then selecting a day where the decorator was applied, the Decorator disappears.

    The day that got selected, then unselected, just gets the normal look for days, and the decorator isn't reloaded.

    Is there a special manipulation to do ?

    opened by FuSoftware 4
  • Change Arrow Indicator Image

    Change Arrow Indicator Image

    Hi, your library is awesome. but is it possible to change the Arrow Indicator Image for next and prev changing month in calendar view ? I need to custom that for my assignment. Really appreciate your help.

    opened by Kishou 2
  • Disable all previous dates from current date and disable unavailable dates

    Disable all previous dates from current date and disable unavailable dates

    If a user wants to book an appointment, all the previous dates from current date should be disabled and it should also disable weekend dates as well as unavailable dates

    opened by AmeyJahagirdar1991 2
  • Make all Past date Unselectable.

    Make all Past date Unselectable.

    Hello,

    Thanks for the awesome library for CalendarView. One thing I want to do it, I want to make all past date Unselectable in Calendar. No past date should be selected. And no one should go to past month as well. Can you help me achieve this ?

    Thanks In Advance.

    opened by darshanpopat 1
  • how can I selected a date?

    how can I selected a date?

    If I do Calendar currentCalendar = Calendar.getInstance(Locale.getDefault()); mCv.refreshCalendar(currentCalendar);

    This highlights the actual date, but how can I actually selected the date? I can't find any method or function to do so.

    opened by x-wf 1
  • change style theme to AppCompat

    change style theme to AppCompat

    Hi,

    is it possible to change the parent theme for this custom view, including a new styled theme, such as Theme.AppCompat.Light.NoActionBar?

    Thanks

    Andrea

    opened by andreamontanari 1
  • Add point in day cell determine event in the day

    Add point in day cell determine event in the day

    Thanks for your work it's really great awesome library

    I need to custom the day cell so i can add upper-right point to determine that this day have event inside it , can you help please

    opened by MarioGamal55 0
  • How to change the color of the days before Today's date

    How to change the color of the days before Today's date

    Hi I am using your lib and it is quite simple and to understand. Thanks for that. But I need to know that Can we change the color of the dates that are passed. Like if its 28-11-16 then change the color of the earlier days.

    @Regards

    opened by AtulaGuleria 0
  • make date of saturday to red color

    make date of saturday to red color

    hellow, first of all i want to thank you for your awesome Calender view... now what i m trying to implement is make saturday's date text color to red color. thanks in advance

    opened by nawinkhatiwada 0
  • Failed to resolve: com.github.npanigrahy:Custom-Calendar-View:v1.0

    Failed to resolve: com.github.npanigrahy:Custom-Calendar-View:v1.0

    Hi,

    Can you please help me to solve this?

    Failed to resolve: com.github.npanigrahy:Custom-Calendar-View:v1.0 Show in Project Structure dialog Affected Modules: app

    opened by Balaaravindh 0
  • Swipe date range selection

    Swipe date range selection

    Hi, Your library is awesome. I only need to know that how can i add swipe to select date range in this. for example If i tap and hold on 1 and drag to 5 then select dates between 1 to 5

    Best Regards

    opened by agi-umar 0
Releases(v1.0)
  • v1.0(Sep 15, 2015)

    Custom-Calendar-View v1.0 release note

    1. Next and precious month navigation
    2. Allows various customizations including background color for day, week, and title
    3. Sets global custom typeface using setCustomTypeFace() method.
    4. Show hide overflow days for the current month
    5. Set custom day options for start day of week. By default it is set to Calendar.SUNDAY
    6. Unlimited customizations for day of the month using custom Decorators.
    7. Allow you to handle event when user changes month and day selection.
    Source code(tar.gz)
    Source code(zip)
Owner
Nilanchala Panigrahy
Solutions Architect at Ness Digital Engineering.
Nilanchala Panigrahy
Android layout decorators : Injecting custom attributes in layout files, Using decorators to get rid of unnecessary class explosion with custom views

Decor Decor is a library that applies decorators to Android layout with additional attributes without the need to extend and create a custom View for

Mouna Cheikhna 304 Nov 25, 2022
Drag and drop to reorder items in a list, grid or board for Android. Based on RecyclerView. Also supports swiping items in a list.

DragListView DragListView can be used when you want to be able to re-order items in a list, grid or a board. It also supports horizontal swiping of it

Magnus Woxblom 658 Nov 30, 2022
Cube grid animation about the android.

CubeGrid Cube grid animation about the android. The android implementation about the 9-cube-grid Demo Usage Add dependency allprojects { repositories

alighters 218 Nov 23, 2022
An Android custom view to display digits rendered as dots in a grid, with a style like a 1970s LED clock.

#DotMatrixView This is an Android library project providing a custom view that can display things on a grid of dots. When the displayed value changes,

Mark Roberts 48 Apr 21, 2022
An Android application which visualizes some of the famous Algorithms for finding path from Source to Destination in a 2D grid.

Pathfinding-Visualizer An Android application which visualizes some of the famous Algorithms for finding path from Source to destination in a 2D grid.

Pranjal Mishra 37 Aug 8, 2022
A small, easy to use android library for implementing flipping between views as seen in the popular Flipboard application

FlipView About This library is made to be very easy to use and at the same time be feature complete. With only a few lines of code you can have a flip

Emil Sjölander 924 Nov 10, 2022
⚡️A highly customizable, powerful and easy-to-use alerting library for Android.

Flashbar A highly customizable, powerful and easy-to-use alerting library for Android. Specs This library allows you to show messages or alerts in you

Aritra Roy 1.7k Dec 7, 2022
A simple, customizable and easy to use swipeable view stack for Android.

SwipeStack A simple, customizable and easy to use swipeable view stack for Android. QuickStart Include the Gradle dependency dependencies { compil

Frederik Schweiger 1.5k Dec 30, 2022
Android view that allows the user to create drawings. Customize settings like color, width or tools. Undo or redo actions. Zoom into DrawView and add a background.

DrawView Android view that allows the user to create drawings. Draw anything you like in your Android device from simple view. Customize draw settings

Oscar Gilberto Medina Cruz 839 Dec 28, 2022
💳 CreditCardView is an Android library that allows developers to create the UI which replicates an actual Credit Card.

CreditCard View CreditCardView is an Android library that allows developers to create the UI which replicates an actual Credit Card. Displaying and en

Vinay Gaba 769 Dec 14, 2022
💳 A quick and easy flip view through which you can create views with two sides like credit cards, poker cards etc.

The article on how this library was created is now published. You can read it on this link here. →. ?? EasyFlipView Built with ❤︎ by Wajahat Karim and

Wajahat Karim 1.3k Dec 14, 2022
This project has been superseded by SuperSLiM, a layout manager for RecyclerView. I strongly recommend using SuperSLiM and not StickyGridHeaders.

StickyGridHeaders Replacement project at SuperSLiM This repository is abandoned and will no longer see any development or support. The replacement Sup

Tonic Artos 1.5k Nov 15, 2022
FogView is a android library that can show fog on any layout and the fog removes when user rubs it.

Fog View Android Library Min SDK 8 (Android 2.2–2.2.3 Froyo) Screnshots How to use If you want use this library, you can download project and import i

Chetan Kaushik 631 Dec 31, 2022
[] A simple way to "badge" any given Android view at runtime without having to cater for it in layout

Android ViewBadger A simple way to "badge" any given Android view at runtime without having to cater for it in layout. Note: If your aim is to replica

Jeff Gilfelt 3k Nov 28, 2022
Shadow layout, shadow view for android.

ShadowViewHelper Shadow layout, shadow view for android. How to use: It's very simple to use. Gradle(Check newest version): compile 'com.github.wangji

WangJie 777 Dec 30, 2022
JetCompose - Blur Effect in Android 12 with motion layout carousel

JetCompose Blur Effect in Android 12 with motion layout carousel

Vikas Singh 4 Jul 27, 2022
Google Calendar Recurrence picker

Android Recurrence Picker Google Calendar Recurrence picker Screenshot Usage Maven / Gradle Maven: <dependency> <groupId>be.billington.calendar.recu

Benoit Billington 240 Nov 29, 2022
A nicer-looking, more intuitive and highly customizable alternative for radio buttons and dropdowns for Android.

SwipeSelector Undergoing for some API changes for a 2.0 major version, see example usage in the sample module! What and why? Bored of dull looking rad

Iiro Krankka 1.1k Dec 30, 2022
:balloon: A lightweight popup like tooltips, fully customizable with an arrow and animations.

Balloon ?? A lightweight popup like tooltips, fully customizable with arrow and animations. Including in your project Gradle Add below codes to your r

Jaewoong Eum 2.8k Jan 5, 2023