当前位置: 首页>>代码示例>>Java>>正文


Java CalendarDay.getYear方法代码示例

本文整理汇总了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);
}
 
开发者ID:Pattonville-App-Development-Team,项目名称:Android-App,代码行数:18,代码来源:FixedMaterialCalendarView.java

示例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();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:11,代码来源:DynamicSettersActivity.java

示例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));
}
 
开发者ID:chymtt,项目名称:ReactNativeCalendarAndroid,代码行数:22,代码来源:CalendarManager.java

示例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());
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:7,代码来源:PeriodActivity.java


注:本文中的com.prolificinteractive.materialcalendarview.CalendarDay.getYear方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。