CalendarView
一个自带农历和节假日的开源日历库
这是一个自带节假日和滑动的日历控件,欢迎各位拍砖
⊙开源不易,希望给个star或者fork奖励
特点
1、支持ViewPager形式的左右滑动
2、支持点击效果
3、支持农历和周末的颜色显示
使用方法
compile 'com.nanchen.calendarview:calendarview:1.0.7'
或者
<dependency\>
<groupId>com.nanchen.calendarview</groupId>
<artifactId>calendarview</artifactId>
<version>1.0.7</version>
<type>pom</type>
</dependency>
2017年1月5日后仓库迁移移到jitpack,添加依赖方式为:
Step 1. Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Step 2. Add the dependency
dependencies {
compile 'com.github.nanchen2251:CalendarView:1.0.7'
}
<com.nanchen.calendarview.MyCalendarView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/calendarView"/>
MyCalendarView calendarView = (MyCalendarView) window.findViewById(R.id.calendarView);
calendarView.setClickDataListener(new ClickDataListener() {
@Override
public void clickData(int year, int month, int day) {
date = String.format(Locale.CHINA, "%04d-%02d-%02d", year, month, day);
Toast.showToast(MainActivity.this.getApplicationContext(),date,Toast.LENGTH_SHORT).show();
}
});
关于作者
南尘
四川成都
博客园