GithubHelp home page GithubHelp logo

calendarview's Introduction

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

关于作者

   南尘
   四川成都
   博客园

calendarview's People

Contributors

nanchen2251 avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.