開源框架镐牺,materialcalendar,github地址如下
https://github.com/prolificinteractive/material-calendarview
根據(jù)業(yè)務(wù)需求魁莉,要增加簽到功能睬涧,查看現(xiàn)有框架,material calendar 的github星比較多旗唁,可定制性也比較符合要求
使用的話比較簡單畦浓,根據(jù)作者給出的引入文檔,在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>