Skip to content

Commit

Permalink
Create CalendarAdapter.md
Browse files Browse the repository at this point in the history
  • Loading branch information
yannecer authored Nov 8, 2019
1 parent a86dc7b commit 8482469
Showing 1 changed file with 74 additions and 0 deletions.
74 changes: 74 additions & 0 deletions CalendarAdapter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@


#### CalendarAdapter 日历适配器,获取日历Item和日历背景,再通过onBoind...设置对应的数据,具体用法参见demo


/**
* 获取日历背景View,可用于做背景渐变等,不需要可不用实现
*
* @param context
* @return
*/
public View getCalendarBackgroundView(Context context) {
return null;
}

/**
* 绑定日历背景View,不需要可不用实现
*
* @param iCalendarView ICalendarView 日历页面,可判断是月日历或者周日历
* @param calendarBackgroundView 日历View,即是getCalendarBackgroundView获取的view
* @param localDate
* @param totalDistance 滑动的全部距离
* @param currentDistance 当前位置的距离
*/
public void onBindCalendarBackgroundView(ICalendarView iCalendarView, View calendarBackgroundView, LocalDate localDate, int totalDistance, int currentDistance) {

}

/**
* 获取日历item的View
*
* @param context
* @return
*/
public abstract View getCalendarItemView(Context context);


/**
* 绑定今天的数据
*
* @param calendarItemView
* @param localDate
* @param selectedDateList
*/
public abstract void onBindToadyView(View calendarItemView, LocalDate localDate, List<LocalDate> selectedDateList);

/**
* 绑定除今天的当月数据
*
* @param calendarItemView
* @param localDate
* @param selectedDateList
*/
public abstract void onBindCurrentMonthOrWeekView(View calendarItemView, LocalDate localDate, List<LocalDate> selectedDateList);

/**
* 绑定上下月的数据 周日历可不用实现
*
* @param calendarItemView
* @param localDate
* @param selectedDateList
*/
public abstract void onBindLastOrNextMonthView(View calendarItemView, LocalDate localDate, List<LocalDate> selectedDateList);

/**
* 绑定不可用的日期数据,和方法setDateInterval(startFormatDate, endFormatDate)对应,
* 如果没有使用setDateInterval设置日期范围 此方法不用实现
*
* @param calendarItemView
* @param localDate
*/
public void onBindDisableDateView(View calendarItemView, LocalDate localDate) {

}

0 comments on commit 8482469

Please sign in to comment.