Search in sources :

Example 1 with HighlightWeekendsDecorator

use of com.prolificinteractive.materialcalendarview.sample.decorators.HighlightWeekendsDecorator in project material-calendarview by prolificinteractive.

the class BasicActivityDecorated method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_basic);
    ButterKnife.bind(this);
    widget.setOnDateChangedListener(this);
    widget.setShowOtherDates(MaterialCalendarView.SHOW_ALL);
    final LocalDate instance = LocalDate.now();
    widget.setSelectedDate(instance);
    final LocalDate min = LocalDate.of(instance.getYear(), Month.JANUARY, 1);
    final LocalDate max = LocalDate.of(instance.getYear(), Month.DECEMBER, 31);
    widget.state().edit().setMinimumDate(min).setMaximumDate(max).commit();
    widget.addDecorators(new MySelectorDecorator(this), new HighlightWeekendsDecorator(), oneDayDecorator);
    new ApiSimulator().executeOnExecutor(Executors.newSingleThreadExecutor());
}
Also used : HighlightWeekendsDecorator(com.prolificinteractive.materialcalendarview.sample.decorators.HighlightWeekendsDecorator) MySelectorDecorator(com.prolificinteractive.materialcalendarview.sample.decorators.MySelectorDecorator) LocalDate(org.threeten.bp.LocalDate)

Example 2 with HighlightWeekendsDecorator

use of com.prolificinteractive.materialcalendarview.sample.decorators.HighlightWeekendsDecorator in project material-calendarview by prolificinteractive.

the class SwappableBasicActivityDecorated method onCreate.

@Override
protected void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_basic_modes);
    ButterKnife.bind(this);
    widget.setOnDateChangedListener(this);
    widget.setShowOtherDates(MaterialCalendarView.SHOW_ALL);
    final LocalDate instance = LocalDate.now();
    widget.setSelectedDate(instance);
    final LocalDate min = LocalDate.of(instance.getYear(), Month.JANUARY, 1);
    final LocalDate max = LocalDate.of(instance.getYear(), Month.DECEMBER, 31);
    widget.state().edit().setMinimumDate(min).setMaximumDate(max).commit();
    widget.addDecorators(new MySelectorDecorator(this), new HighlightWeekendsDecorator(), oneDayDecorator);
}
Also used : HighlightWeekendsDecorator(com.prolificinteractive.materialcalendarview.sample.decorators.HighlightWeekendsDecorator) MySelectorDecorator(com.prolificinteractive.materialcalendarview.sample.decorators.MySelectorDecorator) LocalDate(org.threeten.bp.LocalDate)

Aggregations

HighlightWeekendsDecorator (com.prolificinteractive.materialcalendarview.sample.decorators.HighlightWeekendsDecorator)2 MySelectorDecorator (com.prolificinteractive.materialcalendarview.sample.decorators.MySelectorDecorator)2 LocalDate (org.threeten.bp.LocalDate)2