开源框架,materialcalendar,github地址如下
https://github.com/prolificinteractive/material-calendarview
根据业务需求,要增加签到功能,查看现有框架,material calendar 的github星比较多,可定制性也比较符合要求
使用的话比较简单,根据作者给出的引入文档,在gredle中dependencies配置
implementation'com.github.prolificinteractive:material-calendarview:1.5.0'
另外需要
allprojects {
repositories {
jcenter()
google()
maven{url'https://jitpack.io'}
mavenCentral()
}
}
在xml中引入
<android.support.constraint.ConstraintLayout
<com.prolificinteractive.materialcalendarview.MaterialCalendarView
android:id="@+id/calendarView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/calendar_white_bg"
android:padding="5dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:mcv_arrowColor="#00a9c0"
app:mcv_calendarMode="month"
app:mcv_leftArrowMask="@drawable/ic_back_past"
app:mcv_rightArrowMask="@drawable/ic_arrow_now"
app:mcv_selectionColor="#00a9c0"
app:mcv_showOtherDates="all"
app:mcv_tileSize="40dp" />
</android.support.constraint.ConstraintLayout>