{"id":20958513,"url":"https://github.com/junixapp/xpopupext","last_synced_at":"2025-10-28T21:32:34.949Z","repository":{"id":37366641,"uuid":"272738680","full_name":"junixapp/XPopupExt","owner":"junixapp","description":"XPopup扩展功能库，基于XPopup强大的弹窗能力和PickerView的选择器逻辑，封装了时间选择器弹窗、城市选择器弹窗和条件选择器。","archived":false,"fork":false,"pushed_at":"2023-12-09T07:39:25.000Z","size":662,"stargazers_count":344,"open_issues_count":17,"forks_count":36,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-30T19:11:04.044Z","etag":null,"topics":["android","citypicker","datepicker","picker","pickerview","popup","xpopup"],"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/junixapp.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-06-16T15:02:58.000Z","updated_at":"2025-03-27T19:12:01.000Z","dependencies_parsed_at":"2024-02-27T03:47:39.428Z","dependency_job_id":null,"html_url":"https://github.com/junixapp/XPopupExt","commit_stats":null,"previous_names":["junixapp/xpopupext"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junixapp%2FXPopupExt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junixapp%2FXPopupExt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junixapp%2FXPopupExt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junixapp%2FXPopupExt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/junixapp","download_url":"https://codeload.github.com/junixapp/XPopupExt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247557767,"owners_count":20958047,"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":["android","citypicker","datepicker","picker","pickerview","popup","xpopup"],"created_at":"2024-11-19T01:47:58.695Z","updated_at":"2025-10-28T21:32:29.905Z","avatar_url":"https://github.com/junixapp.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# XPopupExt\nXPopupExt是XPopup的扩展功能库，由于对PickerView自身的UI和交互不满意，就结合XPopup强大的弹窗能力和PickerView的选择器逻辑，封装的了新的选择器弹窗和城市选择器弹窗。\n\n## 演示\n![](gif/preview.gif)\n\n## 使用\n[![](https://jitpack.io/v/li-xiaojun/XPopupExt.svg)](https://jitpack.io/#li-xiaojun/XPopupExt)\n- 添加依赖\n```\nimplementation 'com.github.li-xiaojun:XPopupExt:最新版本看上面'\n//由于扩展库依赖XPopup才能正常使用，所以还必须添加XPopup依赖\nimplementation 'com.github.li-xiaojun:XPopup:2.2.25'\n```\n\n**Add it in your root build.gradle at the end of repositories:**\n```\nallprojects {\n    repositories {\n        ...\n        maven { url 'https://jitpack.io' }\n    }\n}\n```\n\n- 时间选择器TimerPickerPopup弹窗，使用示例:\n```java\nCalendar date = Calendar.getInstance();\ndate.set(2000, 5,1);\nCalendar date2 = Calendar.getInstance();\ndate2.set(2020, 5,1);\nTimePickerPopup popup = new TimePickerPopup(MainActivity.this)\n//                        .setDefaultDate(date)  //设置默认选中日期\n//                        .setYearRange(1990, 1999) //设置年份范围\n//                        .setDateRange(date, date2) //设置日期范围\n        .setTimePickerListener(new TimePickerListener() {\n            @Override\n            public void onTimeChanged(Date date) {\n                //时间改变\n            }\n            @Override\n            public void onTimeConfirm(Date date, View view) {\n                //点击确认时间\n                Toast.makeText(MainActivity.this, \"选择的时间：\"+date.toLocaleString(), Toast.LENGTH_SHORT).show();\n            }\n        });\n\nnew XPopup.Builder(MainActivity.this)\n        .asCustom(popup)\n        .show();\n```\n`TimerPickerPopup`还提供了一些设置方法，具体看方法说明即可。\n\n- 城市选择器，CityPickerPopup弹窗使用示例：\n```java\nCityPickerPopup popup = new CityPickerPopup(MainActivity.this);\npopup.setCityPickerListener(new CityPickerListener() {\n    @Override\n    public void onCityConfirm(String province, String city, String area, View v) {\n        Log.e(\"tag\", province +\" - \" +city+\" - \" +area);\n        Toast.makeText(MainActivity.this, province +\" - \" +city+\" - \" +area, Toast.LENGTH_SHORT).show();\n    }\n    @Override\n    public void onCityChange(String province, String city, String area) {\n        Log.e(\"tag\", province +\" - \" +city+\" - \" +area);\n        Toast.makeText(MainActivity.this, province +\" - \" +city+\" - \" +area, Toast.LENGTH_SHORT).show();\n    }\n});\nnew XPopup.Builder(MainActivity.this)\n        .asCustom(popup)\n        .show();\n```\n\n- 通用列表选择器\n```java\nCommonPickerPopup popup = new CommonPickerPopup(MainActivity.this);\nArrayList\u003cString\u003e list = new ArrayList\u003cString\u003e();\nlist.add(\"小猫\");\nlist.add(\"小狗\");\nlist.add(\"小羊\");\npopup.setPickerData(list)\n        .setCurrentItem(1);\npopup.setCommonPickerListener(new CommonPickerListener() {\n    @Override\n    public void onItemSelected(int index, String data) {\n        Toast.makeText(MainActivity.this, \"选中的是 \"+ data, Toast.LENGTH_SHORT).show();\n    }\n});\nnew XPopup.Builder(MainActivity.this)\n        .asCustom(popup)\n        .show();\n```\n\n- 混淆\n```\n-keep class com.lxj.xpopupext.bean.** { ; }\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunixapp%2Fxpopupext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjunixapp%2Fxpopupext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunixapp%2Fxpopupext/lists"}