GithubHelp home page GithubHelp logo

dgntby / calendar Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xiaojianglaile/calendar

0.0 2.0 0.0 2.52 MB

Android日历 仿小米 华为 滴答清单 365日历(农历),周视图 月视图 平滑滚动 节假日 五六行周切换 week or month calendar

Java 100.00%

calendar's Introduction

Calendar(觉得好用记得帮忙Star哦)

注意事项:

该Demo没有进行网络数据的联调,使用了本地数据库进行存储数据,有需要网络配置的可删除本地数据库相关代码,再去进行网络数据显示即可。

交流QQ群:

小江Android交流群(259194144),进群备注Android、Github之类的关键词即可。

使用方法:

  • MonthCalendarView的使用
<com.jeek.calendar.widget.calendar.month.MonthCalendarView
    android:id="@+id/mcvCalendar"
    android:layout_width="match_parent"
    android:layout_height="@dimen/small_month_calendar_height"
    app:month_day_text_size="@integer/small_calendar_text_size"
    app:month_selected_circle_color="@color/color_select_date_dialog_edit_text_bg_focus"
    app:month_selected_circle_today_color="@color/color_select_date_dialog_edit_text_bg_focus"
    app:month_show_lunar="true"
    app:month_show_task_hint="false"
    app:month_show_holiday_hint="true"
    app:month_text_size="@integer/small_calendar_text_size"/>
  • ScheduleLayout的使用

layout_schedule.xml文件,必须包含MonthCalendarView、WeekCalendarView和ScheduleRecyclerView,可以直接引用改文件作为布局。

ScheduleLayout:
app:default_view="week" <!-默认周视图->
app:default_view="month" <!-默认月视图->
app:auto_change_month_row="false" <!-不自动改变五六行->
app:auto_change_month_row="true" <!-自动改变五六行->
  • 设置日期监听
slSchedule.setOnCalendarClickListener(new OnCalendarClickListener() {
    @Override
    public void onClickDate(int year, int month, int day) {
        //监听获得点击的年月日
    }
});
  • 跳转到今天
slSchedule.getMonthCalendar().setTodayToView();
  • 跳转到某一天
slSchedule.initData(year, month, day);
  • 缺点

该日历暂时没有支持无限循环,需要查看很多日期的朋友可以在MonthAdapter和WeekAdapter调高SIZE的大小即可。

效果图:

image image

calendar's People

Contributors

xiaojianglaile avatar senlinxuefeng avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.