本文整理汇总了Java中com.prolificinteractive.materialcalendarview.CalendarDay.getYear方法的典型用法代码示例。如果您正苦于以下问题:Java CalendarDay.getYear方法的具体用法?Java CalendarDay.getYear怎么用?Java CalendarDay.getYear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.prolificinteractive.materialcalendarview.CalendarDay
的用法示例。
在下文中一共展示了CalendarDay.getYear方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onDateClickedMoveMonth
import com.prolificinteractive.materialcalendarview.CalendarDay; //导入方法依赖的package包/类
public void onDateClickedMoveMonth(@NonNull final CalendarDay selectedDate, boolean shouldCheck) {
CalendarDay currentDate = getCurrentDate();
final int selectedMonth = selectedDate.getMonth();
final int selectedYear = selectedDate.getYear();
CalendarMode calendarMode = getCalendarMode();
while (calendarMode == CalendarMode.MONTHS && allowClickDaysOutsideCurrentMonth() && (currentDate.getMonth() != selectedMonth || currentDate.getYear() != selectedYear)) {
if (currentDate.isAfter(selectedDate)) {
goToPrevious();
} else if (currentDate.isBefore(selectedDate)) {
goToNext();
}
currentDate = getCurrentDate();
}
onDateClicked(selectedDate, shouldCheck);
}
示例2: showDatePickerDialog
import com.prolificinteractive.materialcalendarview.CalendarDay; //导入方法依赖的package包/类
public static void showDatePickerDialog(Context context, CalendarDay day,
DatePickerDialog.OnDateSetListener callback) {
if (day == null) {
day = CalendarDay.today();
}
DatePickerDialog dialog = new DatePickerDialog(
context, 0, callback, day.getYear(), day.getMonth(), day.getDay()
);
dialog.show();
}
示例3: shouldUpdateMinMaxDate
import com.prolificinteractive.materialcalendarview.CalendarDay; //导入方法依赖的package包/类
/**
* Should update new value of minimum or maximum date
*
* Check if the new min or max date is different from the previous one, if yes we update otherwise we don't.
*
* @param minMaxDate
* @param newDate
* @return boolean
*/
private boolean shouldUpdateMinMaxDate(CalendarDay minMaxDate, Date newDate) {
if (minMaxDate == null) {
return true;
}
java.util.Calendar newDateCalendar = java.util.Calendar.getInstance();
newDateCalendar.setTimeInMillis(newDate.getTime());
return (minMaxDate.getYear() != newDateCalendar.get(java.util.Calendar.YEAR) &&
minMaxDate.getMonth() != newDateCalendar.get(java.util.Calendar.MONTH) &&
minMaxDate.getDay() != newDateCalendar.get(java.util.Calendar.DAY_OF_MONTH));
}
示例4: onMonthChanged
import com.prolificinteractive.materialcalendarview.CalendarDay; //导入方法依赖的package包/类
public void onMonthChanged(MaterialCalendarView materialCalendarView, CalendarDay
calendarDay) {
PeriodActivity.this.currentYear = calendarDay.getYear();
PeriodActivity.this.currentMonth = calendarDay.getMonth() + 1;
PeriodActivity.this.getMcStatus(PeriodActivity.this.getCurrentYearMonth());
}