// Path: app/src/main/java/cn/libery/calendar/MaterialCalendar/format/ArrayWeekDayFormatter.java
// public class ArrayWeekDayFormatter implements WeekDayFormatter {
// 
//     private final CharSequence[] weekDayLabels;
// 
//     /**
//      * @param weekDayLabels an array of 7 labels, starting with Sunday
//      */
//     public ArrayWeekDayFormatter(CharSequence[] weekDayLabels) {
//         if(weekDayLabels == null) {
//             throw new IllegalArgumentException("Cannot be null");
//         }
//         if(weekDayLabels.length != 7) {
//             throw new IllegalArgumentException("Array must contain exactly 7 elements");
//         }
//         this.weekDayLabels = weekDayLabels;
//     }
// 
//     /**
//      * {@inheritDoc}
//      */
//     @Override
//     public CharSequence format(int dayOfWeek) {
//         return weekDayLabels[dayOfWeek - 1];
//     }
// }
// 
// 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());
// }


import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.ArrayRes;
import android.support.annotation.IntDef;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.util.SparseArray;
import android.util.TypedValue;
import android.view.View;
import android.view.ViewGroup;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.TextView;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import cn.libery.calendar.MaterialCalendar.format.ArrayWeekDayFormatter;
import cn.libery.calendar.MaterialCalendar.format.DayFormatter;
import cn.libery.calendar.MaterialCalendar.format.WeekDayFormatter;
import cn.libery.calendar.R;
    /**
     * The default value is {@link #SHOW_DEFAULTS}, which currently is just {@link #SHOW_DECORATED_DISABLED}.
     * This means that the default visible days are of the current month, in the min-max range.
     *
     * @param showOtherDates flags for showing non-enabled dates
     * @see #SHOW_ALL
     * @see #SHOW_NONE
     * @see #SHOW_DEFAULTS
     * @see #SHOW_OTHER_MONTHS
     * @see #SHOW_OUT_OF_RANGE
     * @see #SHOW_DECORATED_DISABLED
     */
    public void setShowOtherDates(@ShowOtherDates int showOtherDates) {
        adapter.setShowOtherDates(showOtherDates);
    }

    /**
     * Set a formatter for weekday labels.
     *
     * @param formatter the new formatter, null for default
     */
    public void setWeekDayFormatter(WeekDayFormatter formatter) {
        adapter.setWeekDayFormatter(formatter == null ? WeekDayFormatter.DEFAULT : formatter);
    }

    public void setDayFormatter(DayFormatter formatter) {
        adapter.setDayFormatter(formatter == null ? DayFormatter.DEFAULT : formatter);
    }

    public void setWeekDayLabels(CharSequence[] weekDayLabels) {
// Path: app/src/main/java/cn/libery/calendar/MaterialCalendar/format/ArrayWeekDayFormatter.java
// public class ArrayWeekDayFormatter implements WeekDayFormatter {
// 
//     private final CharSequence[] weekDayLabels;
// 
//     /**
//      * @param weekDayLabels an array of 7 labels, starting with Sunday
//      */
//     public ArrayWeekDayFormatter(CharSequence[] weekDayLabels) {
//         if(weekDayLabels == null) {
//             throw new IllegalArgumentException("Cannot be null");
//         }
//         if(weekDayLabels.length != 7) {
//             throw new IllegalArgumentException("Array must contain exactly 7 elements");
//         }
//         this.weekDayLabels = weekDayLabels;
//     }
// 
//     /**
//      * {@inheritDoc}
//      */
//     @Override
//     public CharSequence format(int dayOfWeek) {
//         return weekDayLabels[dayOfWeek - 1];
//     }
// }
// 
// 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
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.ArrayRes;
import android.support.annotation.IntDef;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.util.SparseArray;
import android.util.TypedValue;
import android.view.View;
import android.view.ViewGroup;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.TextView;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import cn.libery.calendar.MaterialCalendar.format.ArrayWeekDayFormatter;
import cn.libery.calendar.MaterialCalendar.format.DayFormatter;
import cn.libery.calendar.MaterialCalendar.format.WeekDayFormatter;
import cn.libery.calendar.R;

    /**
     * The default value is {@link #SHOW_DEFAULTS}, which currently is just {@link #SHOW_DECORATED_DISABLED}.
     * This means that the default visible days are of the current month, in the min-max range.
     *
     * @param showOtherDates flags for showing non-enabled dates
     * @see #SHOW_ALL
     * @see #SHOW_NONE
     * @see #SHOW_DEFAULTS
     * @see #SHOW_OTHER_MONTHS
     * @see #SHOW_OUT_OF_RANGE
     * @see #SHOW_DECORATED_DISABLED
     */
    public void setShowOtherDates(@ShowOtherDates int showOtherDates) {
        adapter.setShowOtherDates(showOtherDates);
    }

    /**
     * Set a formatter for weekday labels.
     *
     * @param formatter the new formatter, null for default
     */
    public void setWeekDayFormatter(WeekDayFormatter formatter) {
        adapter.setWeekDayFormatter(formatter == null ? WeekDayFormatter.DEFAULT : formatter);
    }

    public void setDayFormatter(DayFormatter formatter) {
        adapter.setDayFormatter(formatter == null ? DayFormatter.DEFAULT : formatter);
    }

    public void setWeekDayLabels(CharSequence[] weekDayLabels) {
        setWeekDayFormatter(new ArrayWeekDayFormatter(weekDayLabels));