// Path: app/src/main/java/cn/libery/calendar/MaterialCalendar/format/DayFormatter.java
// public interface DayFormatter {
// 
//     /**
//      * Format a given day into a string
//      *
//      * @param day the day
//      * @return a label for the day
//      */
//     @NonNull
//     String format(@NonNull CalendarDay day);
// 
//     DayFormatter DEFAULT = new DateFormatDayFormatter();
// }
// 
// Path: app/src/main/java/cn/libery/calendar/MaterialCalendar/format/WeekDayFormatter.java
// public interface WeekDayFormatter {
//     /**
//      * Convert a given day of the week into a label
//      *
//      * @param dayOfWeek the day of the week as returned by {@linkplain java.util.Calendar#get(int)} for {@linkplain java.util.Calendar#DAY_OF_YEAR}
//      * @return a label for the day of week
//      */
//     CharSequence format(int dayOfWeek);
// 
//     WeekDayFormatter DEFAULT = new CalendarWeekDayFormatter(CalendarUtils.getInstance());
// }
// 
// Path: app/src/main/java/cn/libery/calendar/MaterialCalendar/MaterialCalendarView.java
// public static boolean showOtherMonths(@ShowOtherDates int showOtherDates) {
//     return (showOtherDates & SHOW_OTHER_MONTHS) != 0;
// }


import android.annotation.SuppressLint;
import android.app.Service;
import android.os.Vibrator;
import android.support.annotation.NonNull;
import android.util.AttributeSet;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnLongClickListener;
import android.view.ViewGroup;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.List;
import cn.libery.calendar.MaterialCalendar.format.DayFormatter;
import cn.libery.calendar.MaterialCalendar.format.WeekDayFormatter;
import static cn.libery.calendar.MaterialCalendar.MaterialCalendarView.SHOW_DEFAULTS;
import static cn.libery.calendar.MaterialCalendar.MaterialCalendarView.showOtherMonths;
import static java.util.Calendar.DATE;
import static java.util.Calendar.DAY_OF_WEEK;
        tempWorkingCalendar.add(DATE, delta);
        return tempWorkingCalendar;
    }

    public void setFirstDayOfWeek(int dayOfWeek) {
        this.firstDayOfWeek = dayOfWeek;

        Calendar calendar = resetAndGetWorkingCalendar();
        calendar.set(DAY_OF_WEEK, dayOfWeek);
        for (WeekDayView dayView : weekDayViews) {
            dayView.setDayOfWeek(calendar);
            calendar.add(DATE, 1);
        }

        calendar = resetAndGetWorkingCalendar();
        for (DayView dayView : monthDayViews) {
            CalendarDay day = CalendarDay.from(calendar);
            dayView.setDay(day);
            calendar.add(DATE, 1);
        }

        updateUi();
    }

    public void setWeekDayFormatter(WeekDayFormatter formatter) {
        for (WeekDayView dayView : weekDayViews) {
            dayView.setWeekDayFormatter(formatter);
        }
    }

// Path: app/src/main/java/cn/libery/calendar/MaterialCalendar/format/DayFormatter.java
// public interface DayFormatter {
// 
//     /**
//      * Format a given day into a string
//      *
//      * @param day the day
//      * @return a label for the day
//      */
//     @NonNull
//     String format(@NonNull CalendarDay day);
// 
//     DayFormatter DEFAULT = new DateFormatDayFormatter();
// }
// 
// Path: app/src/main/java/cn/libery/calendar/MaterialCalendar/format/WeekDayFormatter.java
// public interface WeekDayFormatter {
//     /**
//      * Convert a given day of the week into a label
//      *
//      * @param dayOfWeek the day of the week as returned by {@linkplain java.util.Calendar#get(int)} for {@linkplain java.util.Calendar#DAY_OF_YEAR}
//      * @return a label for the day of week
//      */
//     CharSequence format(int dayOfWeek);
// 
//     WeekDayFormatter DEFAULT = new CalendarWeekDayFormatter(CalendarUtils.getInstance());
// }
// 
// Path: app/src/main/java/cn/libery/calendar/MaterialCalendar/MaterialCalendarView.java
// public static boolean showOtherMonths(@ShowOtherDates int showOtherDates) {
//     return (showOtherDates & SHOW_OTHER_MONTHS) != 0;
// }


// Path: app/src/main/java/cn/libery/calendar/MaterialCalendar/MonthView.java
import android.annotation.SuppressLint;
import android.app.Service;
import android.os.Vibrator;
import android.support.annotation.NonNull;
import android.util.AttributeSet;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnLongClickListener;
import android.view.ViewGroup;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.List;
import cn.libery.calendar.MaterialCalendar.format.DayFormatter;
import cn.libery.calendar.MaterialCalendar.format.WeekDayFormatter;
import static cn.libery.calendar.MaterialCalendar.MaterialCalendarView.SHOW_DEFAULTS;
import static cn.libery.calendar.MaterialCalendar.MaterialCalendarView.showOtherMonths;
import static java.util.Calendar.DATE;
import static java.util.Calendar.DAY_OF_WEEK;

        tempWorkingCalendar.add(DATE, delta);
        return tempWorkingCalendar;
    }

    public void setFirstDayOfWeek(int dayOfWeek) {
        this.firstDayOfWeek = dayOfWeek;

        Calendar calendar = resetAndGetWorkingCalendar();
        calendar.set(DAY_OF_WEEK, dayOfWeek);
        for (WeekDayView dayView : weekDayViews) {
            dayView.setDayOfWeek(calendar);
            calendar.add(DATE, 1);
        }

        calendar = resetAndGetWorkingCalendar();
        for (DayView dayView : monthDayViews) {
            CalendarDay day = CalendarDay.from(calendar);
            dayView.setDay(day);
            calendar.add(DATE, 1);
        }

        updateUi();
    }

    public void setWeekDayFormatter(WeekDayFormatter formatter) {
        for (WeekDayView dayView : weekDayViews) {
            dayView.setWeekDayFormatter(formatter);
        }
    }

    public void setDayFormatter(DayFormatter formatter) {