Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mahendramahi/CalendarView


https://github.com/mahendramahi/CalendarView

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

# CalendarView

Hello Guys. Here are a simple and custom calendar view.

Include `jitpack.io` inside of **root** project `build.gradle`:

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

# In build.gradle
``` java
dependencies {
compile 'com.github.mahendramahi:CalendarView:1.0'
}

```

**XML**

``





**JAVA**

Create a Object
``` java
private CalendarView calendarView;
```

Init The Object
``` java
calendarView = (CalendarView) findViewById(R.id.cal);

calendarView.setFirstDayOfWeek(Calendar.MONDAY);
calendarView.setIsOverflowDateVisible(true);
calendarView.setCurrentDay(new Date(System.currentTimeMillis()));
calendarView.setBackButtonColor(R.color.colorAccent);
calendarView.setNextButtonColor(R.color.colorAccent);
calendarView.refreshCalendar(Calendar.getInstance(Locale.getDefault()));
```

Set Listeners

``` java
calendarView.setOnDateLongClickListener(new CalendarView.OnDateLongClickListener() {
@Override
public void onDateLongClick(@NonNull Date selectedDate) {

//OnDateLongClick Action here

}
});

calendarView.setOnMonthChangedListener(new CalendarView.OnMonthChangedListener() {
@Override
public void onMonthChanged(@NonNull Date monthDate) {

//OnMonthChanged Action Here

}
});
calendarView.setOnDateClickListener(new CalendarView.OnDateClickListener() {
@Override
public void onDateClick(@NonNull Date selectedDate) {

//OnDateClick Action Here

}
});

calendarView.setOnMonthTitleClickListener(new CalendarView.OnMonthTitleClickListener() {
@Override
public void onMonthTitleClick(@NonNull Date selectedDate) {

// OnMonthTitleClick Action here

}
});
```

# Download

Buy Me a Coffee at ko-fi.com


#Thank You