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


Java CalendarDay.from方法代码示例

本文整理汇总了Java中com.prolificinteractive.materialcalendarview.CalendarDay.from方法的典型用法代码示例。如果您正苦于以下问题:Java CalendarDay.from方法的具体用法?Java CalendarDay.from怎么用?Java CalendarDay.from使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.prolificinteractive.materialcalendarview.CalendarDay的用法示例。


在下文中一共展示了CalendarDay.from方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doInBackground

import com.prolificinteractive.materialcalendarview.CalendarDay; //导入方法依赖的package包/类
@Override
protected List<CalendarDay> doInBackground(@NonNull Void... voids) {
    try {
        Thread.sleep(2000);
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
    Calendar calendar = Calendar.getInstance();
    calendar.add(Calendar.MONTH, -2);
    ArrayList<CalendarDay> dates = new ArrayList<>();
    for (int i = 0; i < 30; i++) {
        CalendarDay day = CalendarDay.from(calendar);
        dates.add(day);
        calendar.add(Calendar.DATE, 5);
    }

    return dates;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:19,代码来源:BasicActivityDecorated.java

示例2: onCreate

import com.prolificinteractive.materialcalendarview.CalendarDay; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_basic);
    ButterKnife.bind(this);

    widget.setShowOtherDates(MaterialCalendarView.SHOW_ALL);
    widget.setArrowColor(getResources().getColor(R.color.sample_primary));
    widget.setLeftArrowMask(getResources().getDrawable(R.drawable.ic_navigation_arrow_back));
    widget.setRightArrowMask(getResources().getDrawable(R.drawable.ic_navigation_arrow_forward));
    widget.setSelectionColor(getResources().getColor(R.color.sample_primary));
    widget.setHeaderTextAppearance(R.style.TextAppearance_AppCompat_Medium);
    widget.setWeekDayTextAppearance(R.style.TextAppearance_AppCompat_Medium);
    widget.setDateTextAppearance(R.style.CustomDayTextAppearance);
    widget.setTitleFormatter(new MonthArrayTitleFormatter(getResources().getTextArray(R.array.custom_months)));
    widget.setWeekDayFormatter(new ArrayWeekDayFormatter(getResources().getTextArray(R.array.custom_weekdays)));
    widget.setTileSize((int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 36, getResources().getDisplayMetrics()));
    widget.setTitleAnimationOrientation(MaterialCalendarView.VERTICAL);

    CalendarDay today = CalendarDay.from(2016, 5, 2);
    widget.setCurrentDate(today);
    widget.setSelectedDate(today);

    widget.state().edit()
            .setFirstDayOfWeek(Calendar.WEDNESDAY)
            .setMinimumDate(CalendarDay.from(2016, 4, 3))
            .setMaximumDate(CalendarDay.from(2016, 5, 12))
            .setCalendarDisplayMode(CalendarMode.WEEKS)
            .commit();

}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:32,代码来源:CustomizeCodeActivity.java

示例3: getBooheeCalendarDay

import com.prolificinteractive.materialcalendarview.CalendarDay; //导入方法依赖的package包/类
private BooheeCalendarDay getBooheeCalendarDay(MonthMc mmc) {
    if (mmc == null || mmc.sections == null) {
        return null;
    }
    BooheeCalendarDay booheeCalendarDay = new BooheeCalendarDay();
    for (int i = 0; i < mmc.sections.size(); i++) {
        Section section = (Section) mmc.sections.get(i);
        if ("mc".equals(section.type)) {
            booheeCalendarDay.setColorDayRange(CalendarDay.from(this.currentYear, this
                    .currentMonth - 1, section.start), CalendarDay.from(this.currentYear,
                    this.currentMonth - 1, section.end), Color.parseColor("#FE52B7"));
        } else if (PeriodRecord.PREDICTION.equals(section.type)) {
            booheeCalendarDay.setColorDayRange(CalendarDay.from(this.currentYear, this
                    .currentMonth - 1, section.start), CalendarDay.from(this.currentYear,
                    this.currentMonth - 1, section.end), Color.parseColor("#FAB5D4"));
        } else if (PeriodRecord.PREGNACY.equals(section.type)) {
            booheeCalendarDay.setColorDayRange(CalendarDay.from(this.currentYear, this
                    .currentMonth - 1, section.start), CalendarDay.from(this.currentYear,
                    this.currentMonth - 1, section.end), Color.parseColor("#5856D6"));
        }
    }
    if (TextUtils.isEmpty(mmc.oviposit_day)) {
        return booheeCalendarDay;
    }
    CalendarDay oviCalendarDay = CalendarDay.from(DateHelper.parseString(mmc.oviposit_day));
    booheeCalendarDay.setDrawableDayRange(oviCalendarDay, oviCalendarDay, R.drawable.qt);
    return booheeCalendarDay;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:29,代码来源:PeriodActivity.java

示例4: localDateToCalendarDay

import com.prolificinteractive.materialcalendarview.CalendarDay; //导入方法依赖的package包/类
@Test
public void localDateToCalendarDay() {
  LocalDate localDate = LocalDate.of(2016, 11, 15);
  CalendarDay expectedCalendarDay = CalendarDay.from(2016, 10, 15);
  CalendarDay actualCalendarDay = DateHelper.localDateToCalendarDay(localDate);
  assertEquals(expectedCalendarDay, actualCalendarDay);
}
 
开发者ID:xmartlabs,项目名称:XLMaterialCalendarView,代码行数:8,代码来源:DateHelperTest.java

示例5: calendarDayToLocalDate

import com.prolificinteractive.materialcalendarview.CalendarDay; //导入方法依赖的package包/类
@Test
public void calendarDayToLocalDate() {
  CalendarDay calendarDay = CalendarDay.from(2016, 10, 15);
  LocalDate expectedLocalDate = LocalDate.of(2016, 11, 15);
  LocalDate actualLocalDate = DateHelper.calendarDayToLocalDate(calendarDay);
  assertEquals(expectedLocalDate, actualLocalDate);
}
 
开发者ID:xmartlabs,项目名称:XLMaterialCalendarView,代码行数:8,代码来源:DateHelperTest.java

示例6: calendarDayToYearMonth

import com.prolificinteractive.materialcalendarview.CalendarDay; //导入方法依赖的package包/类
@Test
public void calendarDayToYearMonth() {
  CalendarDay calendarDay = CalendarDay.from(2016, 10, 15);
  YearMonth expectedYearMonth = YearMonth.of(2016, 11);
  YearMonth actuaYearMonth = DateHelper.calendarDayToYearMonth(calendarDay);
  assertEquals(expectedYearMonth, actuaYearMonth);
}
 
开发者ID:xmartlabs,项目名称:XLMaterialCalendarView,代码行数:8,代码来源:DateHelperTest.java

示例7: EventFlexibleItem

import com.prolificinteractive.materialcalendarview.CalendarDay; //导入方法依赖的package包/类
public EventFlexibleItem(Set<DataSource> dataSource, VEvent vEvent) {
    //super(new EventHeader(CalendarDay.from(pair.getValue().getStartDate().getDate())));
    super(null);
    this.dataSources = dataSource;
    this.vEvent = vEvent;
    this.calendarStartDay = CalendarDay.from(vEvent.getStartDate().getDate());
}
 
开发者ID:Pattonville-App-Development-Team,项目名称:Android-App,代码行数:8,代码来源:EventFlexibleItem.java

示例8: setDate

import com.prolificinteractive.materialcalendarview.CalendarDay; //导入方法依赖的package包/类
/**
 * We're changing the internals, so make sure to call {@linkplain MaterialCalendarView#invalidateDecorators()}
 */
public void setDate(Date date) {
    this.date = CalendarDay.from(date);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:7,代码来源:OneDayDecorator.java

示例9: localDateToCalendarDay

import com.prolificinteractive.materialcalendarview.CalendarDay; //导入方法依赖的package包/类
static CalendarDay localDateToCalendarDay(LocalDate localDate) {
  return CalendarDay.from(DateTimeUtils.toDate(localDate.atStartOfDay(ZoneId.systemDefault()).toInstant()));
}
 
开发者ID:xmartlabs,项目名称:XLMaterialCalendarView,代码行数:4,代码来源:DateHelper.java


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