Hello CalendarView —— 日历使用

一个很棒很漂亮的日历,感谢作者的开源。
https://github.com/huanghaibin-dev/CalendarView
记录下第一次使用的注意事项

1、在module中添加相关依赖

implementation 'com.haibin:calendarview:3.4.8'
implementation 'com.github.bumptech.glide:glide:3.7.0'
//noinspection GradleDependency
implementation 'com.android.support:appcompat-v7:27.1.1'
//noinspection GradleDependency
implementation 'com.android.support:design:27.1.1'

2、添加资源文件 values/attrs.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="GroupRecyclerView">
<attr name="group_height" format="dimension" />
<attr name="group_child_offset" format="dimension" />
<attr name="group_background" format="color" />
<attr name="group_text_color" format="color" />
<attr name="group_text_size" format="dimension" />
<attr name="group_center" format="boolean" />
<attr name="group_padding_left" format="dimension" />
<attr name="group_padding_right" format="dimension" />
<attr name="group_has_header" format="boolean" />
</declare-styleable>
</resources>

3、如果仅使用日历,不用滑动收缩,则在布局文件添加

<com.haibin.calendarview.CalendarView
android:id="@+id/calendarView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#fff"
app:month_view="com.haibin.calendarviewproject.simple.SimpleCalendarCardView"
app:week_view="com.haibin.calendarviewproject.simple.SimpleWeekView"
app:week_bar_view="com.haibin.calendarviewproject.EnglishWeekBar"
app:calendar_height="50dp"
app:current_month_text_color="#333333"
app:current_month_lunar_text_color="#CFCFCF"
app:min_year="2004"
app:other_month_text_color="#e1e1e1"
app:scheme_text="假"
app:scheme_text_color="#333"
app:scheme_theme_color="#333"
app:selected_text_color="#fff"
app:selected_theme_color="#333"
app:week_start_with="mon"
app:week_background="#fff"
app:month_view_show_mode="mode_only_current"
app:week_text_color="#111" />

特别的,请注意不要复制这三个路径,自行替换您自己的自定义路径

app:month_view="com.haibin.calendarviewproject.simple.SimpleCalendarCardView"
app:week_view="com.haibin.calendarviewproject.simple.SimpleWeekView"
app:week_bar_view="com.haibin.calendarviewproject.EnglishWeekBar"

详情见 github
结束。

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 2015.4.30——nikki cao 那天跟zb聊天,他说:“我老婆希望我回老家,她说家里谁谁谁赚了多少多少钱...
    nikkicao阅读 6,202评论 6 5
  • 对于写作者而言,写出一篇爆款文章,是每个人的心愿,那么,爆款文章的标准是什么?如何才能写出一篇爆款文章呢? 首先,...
    漫步者说事阅读 4,675评论 0 4
  • 在一个绿色的雨季 伴随着光辉和雨水 我化作森林的精灵 游走在人间三月 在乍泄的春意里 摇身一变 卧在河床中 盛人怜...
    雷玉玲Lyndi阅读 1,878评论 0 0