Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mahendramahi/CalendarView
https://github.com/mahendramahi/CalendarView
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/mahendramahi/CalendarView
- Owner: mahendramahi
- Created: 2017-04-24T12:10:30.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-04-24T20:34:02.000Z (over 7 years ago)
- Last Synced: 2024-08-02T01:20:03.951Z (4 months ago)
- Language: Java
- Size: 3.56 MB
- Stars: 150
- Watchers: 6
- Forks: 24
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-github-android-ui - CalendarView - 简单的自定义日历视图 (日历时间)
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
#Thank You