// Path: library/src/main/java/com/prolificinteractive/materialcalendarview/format/DayFormatter.java
// public interface DayFormatter {
// 
//   /**
//    * Default format for displaying the day.
//    */
//   String DEFAULT_FORMAT = "d";
// 
//   /**
//    * Default implementation used by {@linkplain com.prolificinteractive.materialcalendarview.MaterialCalendarView}
//    */
//   DayFormatter DEFAULT = new DateFormatDayFormatter();
// 
//   /**
//    * Format a given day into a string
//    *
//    * @param day the day
//    * @return a label for the day
//    */
//   @NonNull String format(@NonNull CalendarDay day);
// }
// 
// Path: library/src/main/java/com/prolificinteractive/materialcalendarview/MaterialCalendarView.java
// public static boolean showDecoratedDisabled(@ShowOtherDates int showOtherDates) {
//   return (showOtherDates & SHOW_DECORATED_DISABLED) != 0;
// }
// 
// Path: library/src/main/java/com/prolificinteractive/materialcalendarview/MaterialCalendarView.java
// public static boolean showOtherMonths(@ShowOtherDates int showOtherDates) {
//   return (showOtherDates & SHOW_OTHER_MONTHS) != 0;
// }
// 
// Path: library/src/main/java/com/prolificinteractive/materialcalendarview/MaterialCalendarView.java
// public static boolean showOutOfRange(@ShowOtherDates int showOtherDates) {
//   return (showOtherDates & SHOW_OUT_OF_RANGE) != 0;
// }


import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.RippleDrawable;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.StateListDrawable;
import android.graphics.drawable.shapes.OvalShape;
import android.os.Build;
import android.support.annotation.NonNull;
import android.support.v7.widget.AppCompatCheckedTextView;
import android.text.SpannableString;
import android.text.Spanned;
import android.view.Gravity;
import android.view.View;
import com.prolificinteractive.materialcalendarview.MaterialCalendarView.ShowOtherDates;
import com.prolificinteractive.materialcalendarview.format.DayFormatter;
import java.util.List;
import static com.prolificinteractive.materialcalendarview.MaterialCalendarView.showDecoratedDisabled;
import static com.prolificinteractive.materialcalendarview.MaterialCalendarView.showOtherMonths;
import static com.prolificinteractive.materialcalendarview.MaterialCalendarView.showOutOfRange;
   */
  public void setSelectionDrawable(Drawable drawable) {
    if (drawable == null) {
      this.selectionDrawable = null;
    } else {
      this.selectionDrawable = drawable.getConstantState().newDrawable(getResources());
    }
    regenerateBackground();
  }

  /**
   * @param drawable background to draw behind everything else
   */
  public void setCustomBackground(Drawable drawable) {
    if (drawable == null) {
      this.customBackground = null;
    } else {
      this.customBackground = drawable.getConstantState().newDrawable(getResources());
    }
    invalidate();
  }

  public CalendarDay getDate() {
    return date;
  }

  private void setEnabled() {
    boolean enabled = isInMonth && isInRange && !isDecoratedDisabled;
    super.setEnabled(isInRange && !isDecoratedDisabled);

// Path: library/src/main/java/com/prolificinteractive/materialcalendarview/format/DayFormatter.java
// public interface DayFormatter {
// 
//   /**
//    * Default format for displaying the day.
//    */
//   String DEFAULT_FORMAT = "d";
// 
//   /**
//    * Default implementation used by {@linkplain com.prolificinteractive.materialcalendarview.MaterialCalendarView}
//    */
//   DayFormatter DEFAULT = new DateFormatDayFormatter();
// 
//   /**
//    * Format a given day into a string
//    *
//    * @param day the day
//    * @return a label for the day
//    */
//   @NonNull String format(@NonNull CalendarDay day);
// }
// 
// Path: library/src/main/java/com/prolificinteractive/materialcalendarview/MaterialCalendarView.java
// public static boolean showDecoratedDisabled(@ShowOtherDates int showOtherDates) {
//   return (showOtherDates & SHOW_DECORATED_DISABLED) != 0;
// }
// 
// Path: library/src/main/java/com/prolificinteractive/materialcalendarview/MaterialCalendarView.java
// public static boolean showOtherMonths(@ShowOtherDates int showOtherDates) {
//   return (showOtherDates & SHOW_OTHER_MONTHS) != 0;
// }
// 
// Path: library/src/main/java/com/prolificinteractive/materialcalendarview/MaterialCalendarView.java
// public static boolean showOutOfRange(@ShowOtherDates int showOtherDates) {
//   return (showOtherDates & SHOW_OUT_OF_RANGE) != 0;
// }


// Path: library/src/main/java/com/prolificinteractive/materialcalendarview/DayView.java
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.RippleDrawable;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.StateListDrawable;
import android.graphics.drawable.shapes.OvalShape;
import android.os.Build;
import android.support.annotation.NonNull;
import android.support.v7.widget.AppCompatCheckedTextView;
import android.text.SpannableString;
import android.text.Spanned;
import android.view.Gravity;
import android.view.View;
import com.prolificinteractive.materialcalendarview.MaterialCalendarView.ShowOtherDates;
import com.prolificinteractive.materialcalendarview.format.DayFormatter;
import java.util.List;
import static com.prolificinteractive.materialcalendarview.MaterialCalendarView.showDecoratedDisabled;
import static com.prolificinteractive.materialcalendarview.MaterialCalendarView.showOtherMonths;
import static com.prolificinteractive.materialcalendarview.MaterialCalendarView.showOutOfRange;

   */
  public void setSelectionDrawable(Drawable drawable) {
    if (drawable == null) {
      this.selectionDrawable = null;
    } else {
      this.selectionDrawable = drawable.getConstantState().newDrawable(getResources());
    }
    regenerateBackground();
  }

  /**
   * @param drawable background to draw behind everything else
   */
  public void setCustomBackground(Drawable drawable) {
    if (drawable == null) {
      this.customBackground = null;
    } else {
      this.customBackground = drawable.getConstantState().newDrawable(getResources());
    }
    invalidate();
  }

  public CalendarDay getDate() {
    return date;
  }

  private void setEnabled() {
    boolean enabled = isInMonth && isInRange && !isDecoratedDisabled;
    super.setEnabled(isInRange && !isDecoratedDisabled);

    boolean showOtherMonths = showOtherMonths(showOtherDates);