Skip to content

thomashaertel/android-calendar-view

 
 

Repository files navigation

Android Calendar View

Download Build Status

Android Calender View is fork from https://code.google.com/p/android-calendar-view/ to support using it from Android Studio as a library.

Overview

Android does not offer any calendar view in the SDK. This project is an option for that. Developer can import and use com.exina.android.calendar.CalendarView.CalendarView to display a specified date in a month view, or let user pick up a date from it.

Spinner with single selection

Usage

Add the following code to an activity or fragment to use the calendar view:

   private OnDateSetListener listener = new OnDateSetListener() {
       @Override
       public void onDateSet(com.exina.android.calendar.CalendarView.CalendarView view, int year, int monthOfYear, int dayOfMonth) {
           // Place your code here
       }
   };
    
   public CalendarPickerDialog createCalendarPickerDialog(Calendar calendar) {
       int cyear = calendar.get(Calendar.YEAR);
       int cmonth = calendar.get(Calendar.MONTH);
       int cday = calendar.get(Calendar.DAY_OF_MONTH);
       
       CalendarPickerDialog calendarPicker = new CalendarPickerDialog(getActivity(), listener, cyear, cmonth, cday);
       return calendarPicker;
   }

Building

Gradle

From Bintray

Add maven central to your build.gradle:

buildscript {
  repositories {
    jcenter()
  }
}

repositories {
  jcenter()
}

From maven central

Add maven central to your build.gradle:

buildscript {
  repositories {
    mavenCentral()
  }
}

repositories {
  mavenCentral()
}

Then declare Android Calendar View within your dependencies:

dependencies {
  ...
  compile('com.thomashaertel:android-calendar-view:0.5.0@aar') {
  }
  ...
}

Maven

From maven central

To use Android Calendar View within your maven build simply add

<dependency>
  <artifactId>android-calendar-view</artifactId>
  <version>${android-calendar-view.version}</version>
  <groupId>com.thomashaertel</groupId>
</dependency>

to your pom.xml

If you also want the sources or javadoc add the respective classifier

  <classifier>sources</classifier>

or

  <classifier>javadoc</classifier>

to the dependency.

License

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%