Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/henry-newbie/CalendarView

CalendarListview是一个高度定制的日期选择器,可以满足多选日期的需求
https://github.com/henry-newbie/CalendarView

Last synced: 2 months ago
JSON representation

CalendarListview是一个高度定制的日期选择器,可以满足多选日期的需求

Awesome Lists containing this project

README

        

# CalendarView
================

CalendarView是一个高度定制的日期选择器,可以满足多选日期的需求。

![CalendarView GIF](https://github.com/henry-newbie/CalendarView/blob/master/screenshot/calendar.gif)

### 集成
该库已上传到Jcenter中, 可以再build.gradle中直接添加

dependencies {
compile 'com.henry:calendarview:1.1.2'
}

### 使用

在xml文件中声明DayPickerView


然后在你的代码中设置DataModel(参数集),DatePickerController(回调接口)

DayPickerView.DataModel dataModel = new DayPickerView.DataModel();
dataModel.yearStart = 2016;
dataModel.monthStart = 6;
dataModel.monthCount = 16;
dataModel.defTag = "¥100";
dataModel.leastDaysNum = 2;
dataModel.mostDaysNum = 100;

dayPickerView.setParameter(dataModel, new DatePickerController() {
@Override
public void onDayOfMonthSelected(SimpleMonthAdapter.CalendarDay calendarDay) {
Toast.makeText(context, "onDayOfMonthSelected", Toast.LENGTH_SHORT).show();
}

@Override
public void onDateRangeSelected(List selectedDays) {
Toast.makeText(context, "onDateRangeSelected", Toast.LENGTH_SHORT).show();
}

@Override
public void alertSelectedFail(FailEven even) {
Toast.makeText(context, "alertSelectedFail", Toast.LENGTH_SHORT).show();
}
});

onDayOfMonthSelected(SimpleMonthAdapter.CalendarDay calendarDay); 点击日期回调函数

onDateRangeSelected(List selectedDays); 选择日期范围回调函数

alertSelectedFail(FailEven even); 异常回调函数

---

### 定制




















### 联系我

有问题可以直接在issues中反馈,我会及时fix,欢迎start。

### 感谢

Thanks to [CalendarListview](https://github.com/traex/CalendarListview)。