Android MaterialCalendarView 日历使用 每日签到 您所在的位置:网站首页 手机日历签到 Android MaterialCalendarView 日历使用 每日签到

Android MaterialCalendarView 日历使用 每日签到

2024-07-07 14:13| 来源: 网络整理| 查看: 265

MaterialCalendarView项目开源地址:

https://github.com/prolificinteractive/material-calendarview

集成清单

1.添加compile'com.prolificinteractive:material-calendarview:1.4.2'

2.添加日历控件到布局中

//设置周的文本calendarView.setWeekDayLabels(newString[]{"日","一","二","三","四","五","六"});

//日期点击事件calendarView.setOnDateChangedListener(this);

calendarView.setSelectedDate(CalendarDay.today());//当日选中

//设置选中日期颜色。

calendarView.setSelectionColor(getResources().getColor(R.color.color_fdd369));

calendarView.setTitleFormatter(new DateFormatTitleFormatter(DateTimeFormatter.ofPattern("yyyy年MM月")));//设置当前标题日期格式

calendarView.setSelectionMode(MaterialCalendarView.SELECTION_MODE_MULTIPLE);//默认单选模式  这里选择多选模式

calendarView.setDateSelected(CalendarDay.from(2019, 3, 25), true);//设置当前日期为选中状态

    12sp

    @color/colorWhite

//日历头部字体样式设置

app:mcv_headerTextAppearance="@style/MaterialheaderTextStyelNormal"

//日历时间字体样式设置

app:mcv_weekDayTextAppearance="@style/MaterialCalendarTextStyelNormal"

//设置左边 和右边箭头 图片

app:mcv_leftArrow="@mipmap/leftgo"

app:mcv_rightArrow="@mipmap/rightgo"

//设置头部  标题日期动画方式 横向 还是 竖向 过度

app:mcv_titleAnimationOrientation="horizontal"

//设置日历时间 之间高度

app:mcv_tileHeight="30dp"

//日历从左到右  第一周显示的  (此处是星期天)

app:mcv_firstDayOfWeek="sunday"



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有