{"id":13643477,"url":"https://github.com/henry-newbie/CalendarView","last_synced_at":"2025-04-21T01:32:47.982Z","repository":{"id":217102469,"uuid":"62029705","full_name":"henry-newbie/CalendarView","owner":"henry-newbie","description":"CalendarListview是一个高度定制的日期选择器，可以满足多选日期的需求","archived":false,"fork":false,"pushed_at":"2017-03-10T05:27:14.000Z","size":684,"stargazers_count":386,"open_issues_count":23,"forks_count":61,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-08-02T01:20:03.682Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/henry-newbie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-06-27T06:09:15.000Z","updated_at":"2024-05-25T14:37:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"e42d6251-7c62-4bb9-a2d7-d0e7d129fbf7","html_url":"https://github.com/henry-newbie/CalendarView","commit_stats":null,"previous_names":["henry-newbie/calendarview"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henry-newbie%2FCalendarView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henry-newbie%2FCalendarView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henry-newbie%2FCalendarView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henry-newbie%2FCalendarView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/henry-newbie","download_url":"https://codeload.github.com/henry-newbie/CalendarView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223846080,"owners_count":17213105,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T01:01:48.114Z","updated_at":"2024-11-09T15:30:47.113Z","avatar_url":"https://github.com/henry-newbie.png","language":"Java","funding_links":[],"categories":["日历时间"],"sub_categories":[],"readme":"# CalendarView\r\n================\r\n\r\nCalendarView是一个高度定制的日期选择器，可以满足多选日期的需求。\r\n\r\n![CalendarView GIF](https://github.com/henry-newbie/CalendarView/blob/master/screenshot/calendar.gif)\r\n \r\n### 集成\r\n该库已上传到Jcenter中, 可以再build.gradle中直接添加\r\n\r\n\tdependencies {\r\n\t    compile 'com.henry:calendarview:1.1.2'\r\n\t}\r\n \r\n### 使用\r\n \r\n在xml文件中声明DayPickerView\r\n\r\n\r\n    \u003ccom.henry.calendarview.DayPickerView\r\n        android:id=\"@+id/dpv_calendar\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"match_parent\"\r\n        app:colorCurrentDay=\"@color/colorAccent\"\r\n        app:colorSelectedDayBackground=\"@color/colorAccent\"\r\n        app:colorSelectedDayText=\"@color/selected_day_text\"\r\n        app:colorPreviousDayText=\"#727272\"\r\n        app:colorNormalDayText=\"#727272\"\r\n        app:colorYearMonthText=\"#727272\"\r\n        app:colorWeekText=\"#727272\"\r\n        app:colorBusyDaysBg=\"#727272\"\r\n        app:colorInValidDaysBg=\"#727272\"\r\n        app:colorBusyDaysText=\"#FFFFFF\"\r\n        app:colorInValidDaysText=\"#FFFFFF\"\r\n\r\n        app:textSizeDay=\"14sp\"\r\n        app:textSizeTag=\"12sp\"\r\n        app:textSizeYearMonth=\"16sp\"\r\n        app:textSizeWeek=\"14sp\"\r\n        app:headerMonthHeight=\"50dp\"\r\n        app:selectedDayRadius=\"20dp\"\r\n        app:calendarHeight=\"320dp\"\r\n        app:enablePreviousDay=\"false\"/\u003e\r\n         \r\n\r\n\r\n然后在你的代码中设置DataModel（参数集），DatePickerController（回调接口）\r\n\r\n        DayPickerView.DataModel dataModel = new DayPickerView.DataModel();\r\n        dataModel.yearStart = 2016;\r\n        dataModel.monthStart = 6;\r\n        dataModel.monthCount = 16;\r\n        dataModel.defTag = \"￥100\";\r\n        dataModel.leastDaysNum = 2;\r\n        dataModel.mostDaysNum = 100;\r\n\r\n\t\tdayPickerView.setParameter(dataModel, new DatePickerController() {\r\n            @Override\r\n            public void onDayOfMonthSelected(SimpleMonthAdapter.CalendarDay calendarDay) {\r\n                Toast.makeText(context, \"onDayOfMonthSelected\", Toast.LENGTH_SHORT).show();\r\n            }\r\n\r\n            @Override\r\n            public void onDateRangeSelected(List\u003cSimpleMonthAdapter.CalendarDay\u003e selectedDays) {\r\n                Toast.makeText(context, \"onDateRangeSelected\", Toast.LENGTH_SHORT).show();\r\n            }\r\n\r\n            @Override\r\n            public void alertSelectedFail(FailEven even) {\r\n                Toast.makeText(context, \"alertSelectedFail\", Toast.LENGTH_SHORT).show();\r\n            }\r\n        });\r\n\r\nonDayOfMonthSelected(SimpleMonthAdapter.CalendarDay calendarDay);          点击日期回调函数\r\n\r\nonDateRangeSelected(List\u003cSimpleMonthAdapter.CalendarDay\u003e selectedDays);    选择日期范围回调函数\r\n\r\nalertSelectedFail(FailEven even);\t\t\t\t\t\t\t\t\t\t   异常回调函数\r\n\r\n---\r\n\r\n### 定制\r\n\r\n    \u003cdeclare-styleable name=\"DayPickerView\"\u003e\r\n        \u003cattr name=\"colorCurrentDay\" format=\"color\"/\u003e               \u003c!-- 今天字体颜色 --\u003e\r\n        \u003cattr name=\"colorSelectedDayBackground\" format=\"color\"/\u003e    \u003c!-- 被选中的日期背景颜色 --\u003e\r\n        \u003cattr name=\"colorSelectedDayText\" format=\"color\"/\u003e          \u003c!-- 被选中的日期字体颜色 --\u003e\r\n        \u003cattr name=\"colorPreviousDayText\" format=\"color\"/\u003e          \u003c!-- 已过去的日期字体颜色 --\u003e\r\n        \u003cattr name=\"colorNormalDayText\" format=\"color\" /\u003e           \u003c!-- 正常日期颜色 --\u003e\r\n        \u003cattr name=\"colorYearMonthText\" format=\"color\" /\u003e           \u003c!-- 头部年份月份字体颜色 --\u003e\r\n        \u003cattr name=\"colorWeekText\" format=\"color\" /\u003e                \u003c!-- 头部星期几字体颜色 --\u003e\r\n        \u003cattr name=\"colorBusyDaysBg\" format=\"color\" /\u003e              \u003c!-- 被占用的日期背景颜色 --\u003e\r\n        \u003cattr name=\"colorInValidDaysBg\" format=\"color\" /\u003e           \u003c!-- 禁用的日期背景颜色 --\u003e\r\n        \u003cattr name=\"colorBusyDaysText\" format=\"color\" /\u003e            \u003c!-- 被占用的日期字体颜色 --\u003e\r\n        \u003cattr name=\"colorInValidDaysText\" format=\"color\" /\u003e         \u003c!-- 禁用的日期字体颜色 --\u003e\r\n\r\n        \u003cattr name=\"textSizeDay\" format=\"dimension\"/\u003e               \u003c!-- 正常日期字体大小 --\u003e\r\n        \u003cattr name=\"textSizeTag\" format=\"dimension\"/\u003e               \u003c!-- 标签字体大小 --\u003e\r\n        \u003cattr name=\"textSizeYearMonth\" format=\"dimension\" /\u003e        \u003c!-- 头部年份月份字体大小 --\u003e\r\n        \u003cattr name=\"textSizeWeek\" format=\"dimension\" /\u003e             \u003c!-- 头部星期几字体大小 --\u003e\r\n        \u003cattr name=\"headerMonthHeight\" format=\"dimension\" /\u003e        \u003c!-- 头部高度 --\u003e\r\n        \u003cattr name=\"selectedDayRadius\" format=\"dimension\" /\u003e        \u003c!-- 日期半径 --\u003e\r\n        \u003cattr name=\"calendarHeight\" format=\"dimension\" /\u003e           \u003c!-- 行高 --\u003e\r\n        \u003cattr name=\"enablePreviousDay\" format=\"boolean\" /\u003e          \u003c!-- 已过去的日期是否能被操作 --\u003e\r\n\t\u003c/declare-styleable\u003e\r\n\r\n### 联系我\r\n\r\n有问题可以直接在issues中反馈，我会及时fix，欢迎start。\r\n\r\n### 感谢\r\n\r\nThanks to [CalendarListview](https://github.com/traex/CalendarListview)。\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhenry-newbie%2FCalendarView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhenry-newbie%2FCalendarView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhenry-newbie%2FCalendarView/lists"}