- 基于recyclerView 日历 制作的 星期 预约控件
dependencies {
implementation 'com.github.AGouLiu:AppointmentTime:latestVersion'
}
- 通过数据驱动 。数据使用map 查询的效率更高效
val map: MutableMap<String, List<String>> = HashMap() // key 日期 - 时段
- list 存时段和预约状态
var array =ArrayList<String>()
array.add("8:00-9:00-true") // true 可约
array.add("10:00-12:00-false") // false 约满
map["2021-9-29-2"] = array // 日期 -时段 1,上午 2 下午 ,3晚上
- 事件回调
var onPageChanged2: ((String, String) -> Unit?)? =null // 页面 切换
var onClickListener: ((CalendarView, Cell) -> Unit)? = null // 点击回调