{"id":13643448,"url":"https://github.com/codbking/CalendarExaple","last_synced_at":"2025-04-21T01:32:46.978Z","repository":{"id":50332662,"uuid":"77349800","full_name":"codbking/CalendarExaple","owner":"codbking","description":"android高仿钉钉和小米的自定义日历控件（支持阴历和阳历，左右无限翻页viewpager）","archived":false,"fork":false,"pushed_at":"2016-12-26T03:42:49.000Z","size":2732,"stargazers_count":1092,"open_issues_count":25,"forks_count":208,"subscribers_count":36,"default_branch":"master","last_synced_at":"2025-04-04T07:44:02.822Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codbking.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-26T01:25:37.000Z","updated_at":"2024-12-31T03:33:48.000Z","dependencies_parsed_at":"2022-09-10T16:01:33.523Z","dependency_job_id":null,"html_url":"https://github.com/codbking/CalendarExaple","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codbking%2FCalendarExaple","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codbking%2FCalendarExaple/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codbking%2FCalendarExaple/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codbking%2FCalendarExaple/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codbking","download_url":"https://codeload.github.com/codbking/CalendarExaple/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249982642,"owners_count":21355735,"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:47.768Z","updated_at":"2025-04-21T01:32:44.828Z","avatar_url":"https://github.com/codbking.png","language":"Java","readme":"\n**关注我**\n\ngithup:[https://github.com/codbking](https://github.com/codbking)\n\ncsdn: [http://my.csdn.net/codbking](http://my.csdn.net/codbking)\n\n****\n# CalendarExaple\n\n# 简介\n这是一个高仿钉钉和小米的日历控件，支持快速滑动，界面缓存。想要定制化UI，使用起来非常简单，就像使用ListView一样\n\n**一些特点：**\n\n1. 可以自定义日历控件UI\n2. 支持快速滑动\n3. 支持农历和阳历\n4. 界面UI缓存和日历数据缓存\n5. 扩展view支持listView的滑动\n\n**效果**\n\n**[apk下载](https://raw.githubusercontent.com/codbking/CalendarExaple/master/calendar_demo.apk)**\n\n*  **先上两张demo的效果图，分别是仿小米和钉钉日历效果图**\n\n\u003cimg src=\"image/a1.jpg\" height=\"576\" width=\"324\" style=\"margin-left:100\"/\u003e\n\u003cimg src=\"image/a2.jpg\"  height=\"576\" width=\"324\" style=\"margin-left:100\"/\u003e\n\n*  **再看下交互效果**\n\n![Alt text](image/bbbb.gif)\n\n\n\n### how to use\n\n - **Add it in your root build.gradle at the end of repositories:**\n\n```\n\t    allprojects {\n\t\t   repositories {\n\t\t\t...\n\t\t\tmaven { url 'https://jitpack.io' }\n\t\t}\n\t    }\n```\n\n -  **Add the dependency**\n```sh\n\tdependencies {\n\t        compile 'com.github.codbking:CalendarExaple:v1.0.0'\n\t}\n```\n\n- **在layout的xml中添加CalendarLayout和CalendarDateView**\n\n  注意：CalendarDateView一定是CalendarLayout第一个view，扩展view必须是CalendarDateView第二个view\n```xml\n   \u003ccom.codbking.calendar.CalendarLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"0dp\"\n        android:layout_weight=\"1\"\n        \u003e\n\n        \u003ccom.codbking.calendar.CalendarDateView\n            android:id=\"@+id/calendarDateView\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"/\u003e\n\n        \u003cListView\n            android:id=\"@+id/list\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:background=\"#ffffff\"\n            /\u003e\n\n    \u003c/com.codbking.calendar.CalendarLayout\u003e\n```\n\n- 在你的java文件中设置CalendarDateView的CaledarAdapter和CalendarView.OnItemClickListener监听\n\n   注意：想要设置选中效果，只需设置CaledarAdapter中的view的选中背景\n```java\n       mCalendarDateView.setAdapter(new CaledarAdapter() {\n            @Override\n            public View getView(View convertView, ViewGroup parentView, CalendarBean bean) {\n                //判断convertView为null，可以有效利用view的回收重用，左右滑动的效率高\n                if (convertView == null) {\n                    convertView = LayoutInflater.from(parentView.getContext()).inflate(R.layout.item_xiaomi, null);\n                }\n\n                TextView chinaText = (TextView) convertView.findViewById(R.id.chinaText);\n                TextView text = (TextView) convertView.findViewById(R.id.text);\n\n                text.setText(\"\" + bean.day);\n                //mothFlag 0是当月，-1是月前，1是月后\n                if (bean.mothFlag != 0) {\n                    text.setTextColor(0xff9299a1);\n                } else {\n                    text.setTextColor(0xff444444);\n                }\n                chinaText.setText(bean.chinaDay);\n\n                return convertView;\n            }\n        });\n\n        mCalendarDateView.setOnItemClickListener(new CalendarView.OnItemClickListener() {\n            @Override\n            public void onItemClick(View view, int postion, CalendarBean bean) {\n                mTitle.setText(bean.year + \"/\" + bean.moth + \"/\" + bean.day);\n            }\n        });\n```\n\n### 联系我\n\n**email:codbking@gmail.com**\n\n\n\n\n\n","funding_links":[],"categories":["日历时间"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodbking%2FCalendarExaple","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodbking%2FCalendarExaple","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodbking%2FCalendarExaple/lists"}