CompactCalendarView

介绍:

一个日历视图控件,可以切换月份,打开和关闭,监听日期选择等事件。基于Java的Date 和 Calendar 类。

运行效果:

使用说明:

依赖

dependencies {
    compile 'com.github.sundeepk:compact-calendar-view:1.8.2'
}
//smooth scrolling functionality with open/close calendar
dependencies {
    compile 'com.github.sundeepk:compact-calendar-view:1.8.3'
}

布局

    <com.github.sundeepk.compactcalendarview.CompactCalendarView
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/compactcalendar_view"
        android:layout_width="fill_parent"
        android:paddingRight="10dp"
        android:paddingLeft="10dp"
        android:layout_height="250dp"
        app:compactCalendarTextSize="12sp"
        app:compactCalendarBackgroundColor="#ffe95451"
        app:compactCalendarTextColor="#fff"
        app:compactCalendarCurrentSelectedDayBackgroundColor="#E57373"
        app:compactCalendarCurrentDayBackgroundColor="#B71C1C"
        />

设置locale将显示星期几

        CompactCalendarView compactCalendarView = (CompactCalendarView) findViewById(R.id.compactcalendar_view);
        compactCalendarView.drawSmallIndicatorForEvents(true);
        compactCalendarView.setLocale(Locale.CHINESE);
        compactCalendarView.setUseThreeLetterAbbreviation(true);

chinese-locale-daynames.png

已下载
0