{"id":16619561,"url":"https://github.com/yanzhenjie/years","last_synced_at":"2025-10-29T21:30:54.169Z","repository":{"id":57729862,"uuid":"117673865","full_name":"yanzhenjie/Years","owner":"yanzhenjie","description":"Just select the year and month view on Android.","archived":false,"fork":false,"pushed_at":"2018-01-29T09:05:37.000Z","size":1383,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-02T04:51:13.382Z","etag":null,"topics":["date-picker","month","year","year-month"],"latest_commit_sha":null,"homepage":"https://github.com/yanzhenjie/Years","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/yanzhenjie.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}},"created_at":"2018-01-16T11:14:26.000Z","updated_at":"2021-01-15T19:57:40.000Z","dependencies_parsed_at":"2022-08-30T06:11:13.647Z","dependency_job_id":null,"html_url":"https://github.com/yanzhenjie/Years","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/yanzhenjie%2FYears","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yanzhenjie%2FYears/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yanzhenjie%2FYears/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yanzhenjie%2FYears/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yanzhenjie","download_url":"https://codeload.github.com/yanzhenjie/Years/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238892428,"owners_count":19548185,"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":["date-picker","month","year","year-month"],"created_at":"2024-10-12T02:42:16.488Z","updated_at":"2025-10-29T21:30:48.580Z","avatar_url":"https://github.com/yanzhenjie.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Years\nJust select the year and month view on Android, its internal use [AndroidWheel](https://github.com/yanzhenjie/AndroidWheel) implementation.\n\n## Screenshot\n\u003cimage src=\"./image/1_en.gif\" width=\"210px\"/\u003e \u003cimage src=\"./image/2_en.gif\" width=\"210px\"/\u003e \u003cimage src=\"./image/1_cn.gif\" width=\"210px\"/\u003e \u003cimage src=\"./image/2_cn.gif\" width=\"210px\"/\u003e\n\nGif's effect may not be very good, this is how it looks when it is quiet.  \n\u003cimage src=\"./image/1_cn.png\" width=\"210px\"/\u003e \u003cimage src=\"./image/2_cn.png\" width=\"210px\"/\u003e  \n\n## Download\n* Gradle\n```\nimplementation 'com.yanzhenjie:years:1.0.0'\n```\n\n* Maven\n```\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.yanzhenjie\u003c/groupId\u003e\n  \u003cartifactId\u003eyears\u003c/artifactId\u003e\n  \u003cversion\u003e1.0.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nAndroidWheel requires at minimum Java 7 or Android 4.0(Api level 14) .\n\n## Usage\nInitialize YearsView:\n```xml\n\u003ccom.yanzhenjie.years.YearsView\n    android:id=\"@+id/years\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\"/\u003e\n```\nOr in Java files:\n```java\nYearsView yearsView = ...;\n```\n\nModify the appearance of the Api:\n```java\nint colors = new int[]{Color.WHITE, Color.TRANSPARENT};\nyearsView.setShadow(colors); // Modify the top and bottom audio.\n\nDrawable drawable = getDrawable(R.drawable.shape_year_filter);\nyearsView.setCenterFilter(Drawable); // Modify the middle of the selector.\n```\n\nSet the data of the API:\n```java\nList\u003cString\u003e yearList = ...;\nyearsView.setYearItemList(yearList);\n\nList\u003cString\u003e monthList = ...;\nyearsView.setMonthItemList(monthList);\n```\n\nOr use the adapter to load the data:\n```java\nyearsView.setYearAdapter(WheelViewAdapter);\nyearsView.setMonthAdapter(WheelViewAdapter);\n```\n\nModify the currently selected Item:\n```java\nint yearIndex = ...;\nint monthIndex = ...;\nyearsView.setYearIndex(yearIndex);\nyearsView.setMonthIndex(monthIndex);\n```\n\nMonitor the value of the wheel:\n```java\nfinal List\u003cString\u003e yearList = ...;\nfinal List\u003cString\u003e monthList = ...;\n\n...\n\nmYearsView.setValueChangedListener(new YearsView.OnValueChangedListener() {\n    @Override\n    public void onChanged(YearsView yearsView, int yearValue, int monthValue) {\n        String year = yearList.get(yearValue);\n        String month = monthList.get(monthValue);\n        ...\n    }\n});\n```\n\nActive obtain the value of the wheel:\n```java\nfinal List\u003cString\u003e yearList = ...;\nfinal List\u003cString\u003e monthList = ...;\n\n...\n\nint yearIndex = mYearsView.getYearIndex();\nint monthIndex = mYearsView.getMonthIndex();\nString year = yearList.get(yearValue);\nString month = monthList.get(monthValue);\n...\n```\n\n## ProGuard\nIf you are using ProGuard you might need to add the following options:\n```\n-dontwarn com.yanzhenjie.wheel.**\n-dontwarn com.yanzhenjie.years.**\n```\n\n## License\n```text\nCopyright 2017 Yan Zhenjie\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyanzhenjie%2Fyears","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyanzhenjie%2Fyears","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyanzhenjie%2Fyears/lists"}