Skip to content

SeductiveMobile/CalendarView

Repository files navigation

CalendarView

CalendarView is a RecycleView based library.

Simple usage

Import

Currently only the clone setup is available. The gradle build setup is in progress.

How to use?

You can check the "sample" module to check common usage.

Requirements

SDK:

    minSdkVersion 15

Gradle:

classpath 'com.android.tools.build:gradle:2.1.0'

Features:

Single selection mode

    calendarViewInstance.setCalendarType(CalendarType.SINGLE_DATE);
    app:app:type="single"

Single selection

Period selection mode

    calendarViewInstance.setCalendarType(CalendarType.PERIOD);
    app:app:type="period"

Period selection

Set calendar period in tmonths

public void setPeriod(int months);

Set period of dates

public void setDates(DateTime dateFrom, DateTime dateTo);

Each row is a Adapter view which appearance can be animated

public void setWeekAnimation(@AnimRes int animation);

Custom backgrounds and text colors:

Programmatically

For each UI element there is a simple class with setters:

WeekDayStyle.java

    public WeekDayStyle setBgColorInactive(int bgColorInactive):

    public WeekDayStyle setBgColorInterval(int bgColorInterval);

    public WeekDayStyle setBgResource(int bgResource);

    public WeekDayStyle setBgColorActive(int bgColorActive);

    public WeekDayStyle setTextColorActive(int textColorActive);

    public WeekDayStyle setTextSize(int textSize);

    public WeekDayStyle setTextStyle(int textStyle);

    public WeekDayStyle setTextGravity(int textGravity);

    public WeekDayStyle setTextTypeface(int textTypeface);

    public WeekDayStyle setTextAllCaps(boolean textAllCaps);

    public WeekDayStyle setTextColorInactive(int textColorInactive);

WeekStyle.java

    public WeekStyle setBgColor(int bgColor);

HeaderStyle.java

    public HeaderStyle setMonthNameTextTypeface(int monthNameTextTypeface);

    public HeaderStyle setMonthNameTextColor(int monthNameTextColor);

    public HeaderStyle setMonthNameTextSize(int monthNameTextSize);

    public HeaderStyle setMonthNameTextStyle(int monthNameTextStyle);

    public HeaderStyle setMonthNameTextGravity(int monthNameTextGravity);

    public HeaderStyle setBgResID(int bgResID);

    public HeaderStyle setBgColor(int bgColor);

    public HeaderStyle setDayNameTextColor(int dayNameTextColor);

    public HeaderStyle setDayNameTextSize(int dayNameTextSize);

    public HeaderStyle setDayNameTextStyle(int dayNameTextStyle);

    public HeaderStyle setDayNameTextGravity(int dayNameTextGravity);

    public HeaderStyle setDayNameTextTypeface(int dayNameTextTypeface);

    public HeaderStyle setDayNameTextAllCaps(boolean dayNameTextAllCaps);

Using attributes

        app:BothDays_bgResource="@android:color/holo_blue_dark"
        app:DestinationDay_bgResource="@android:color/holo_green_light"
        app:DestinationDay_textAppearance="@style/CalendarView.DestinationTextAppearance"
        app:Header_bgColor="@android:color/white"

        app:Header_bgResID="@drawable/calendar_gradient"

        app:Header_dayNameTextAppearance="@style/CalendarView.MonthDayNameTextAppearance"
        app:Header_monthNameTextAppearance="@style/CalendarView.MonthNameTextAppearance"
        app:OriginDay_bgResource="@android:color/holo_blue_bright"
        app:OriginDay_textAppearance="@style/CalendarView.OriginTextAppearance"
        app:WeekDay_bgColorActive="@android:color/white"
        app:WeekDay_bgColorInactive="@android:color/white"

        app:WeekDay_bgColorInterval="@color/calendar_background"
        app:WeekDay_bgResource="@android:color/transparent"

        app:WeekDay_textAppearance="@style/CalendarView.WeekDayTextAppearance"
        app:WeekDay_textColorInactive="@color/calendar_numbers_inactive"

        app:Week_bgColor="@android:color/white"

        app:todayLabelText="@string/label_today"

About

CalendarView is a RecycleView based library.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages