All Projects → nanchen2251 → CalendarView

nanchen2251 / CalendarView

Licence: other
CalendarView,自带农历的日历控件

Programming Languages

java
68154 projects - #9 most used programming language

CalendarView

一个自带农历和节假日的开源日历库

这是一个自带节假日和滑动的日历控件,欢迎各位拍砖

效果图

⊙开源不易,希望给个star或者fork奖励

特点

1、支持ViewPager形式的左右滑动
2、支持点击效果
3、支持农历和周末的颜色显示

使用方法

1、添加依赖

  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'
	}

2、在xml文件里面使用

  <com.nanchen.calendarview.MyCalendarView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/calendarView"/>

3、在Activity里面使用

  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();
           }
       });

关于作者

   南尘
   四川成都
   博客园

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].