{"id":21839705,"url":"https://github.com/yangchaojiang/demoloadview","last_synced_at":"2025-08-22T03:31:46.808Z","repository":{"id":202020245,"uuid":"89841753","full_name":"yangchaojiang/DemoLoadView","owner":"yangchaojiang","description":"切换加载中，加载失败，加载成功布局，定义一个LoadViewHelper所有界面通用，通同时也支持单个自定义无需添加布局中view, 大大降低耦合性","archived":false,"fork":false,"pushed_at":"2018-08-01T09:53:06.000Z","size":14959,"stargazers_count":221,"open_issues_count":0,"forks_count":12,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-08T21:51:12.510Z","etag":null,"topics":["android","loading"],"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/yangchaojiang.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}},"created_at":"2017-04-30T09:30:36.000Z","updated_at":"2024-12-08T15:42:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"62f5eaf6-4a41-44dc-8453-2f84bdfe6a7a","html_url":"https://github.com/yangchaojiang/DemoLoadView","commit_stats":null,"previous_names":["yangchaojiang/demoloadview"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yangchaojiang/DemoLoadView","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yangchaojiang%2FDemoLoadView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yangchaojiang%2FDemoLoadView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yangchaojiang%2FDemoLoadView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yangchaojiang%2FDemoLoadView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yangchaojiang","download_url":"https://codeload.github.com/yangchaojiang/DemoLoadView/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yangchaojiang%2FDemoLoadView/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271579411,"owners_count":24784244,"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","status":"online","status_checked_at":"2025-08-22T02:00:08.480Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","loading"],"created_at":"2024-11-27T21:20:11.939Z","updated_at":"2025-08-22T03:31:45.761Z","avatar_url":"https://github.com/yangchaojiang.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LoadViewHelper\n\n\n\n#切换加载中，加载失败，加载成功布局，支持全局和局部之自定义布局 定义一个LoadViewHelper所有界面通用，无需添加布局中view, 大大降低耦合性。\n\n## LoadViewHelper\n通过Gradle抓取:\n\n```gradle\ncompile 'com.ycjiang:loadviewhelper:1.1.2'\n\n```\n \n\n\n![](images/sss.gif)\n\n### 在你Framgment 或者ACtivity\n\n```\n    LoadViewHelper helper = new LoadViewHelper(listView);  \n\t    //将listview切换成显示加载中布局\n\n\t\thelper.showLoading(\"加载中...\");\n\n\t\t//将listview切换成显示空数据布局\n\t\thelper.showEmpty(\"暂无数据\", \"重试\");\n\t\t//或者\n\t\thelper.showEmpty();\n\t//\t监听重试按钮\n\t\t  helper.setListener(new OnLoadViewListener() {\n                    @Override\n                    public void onRetryClick() {\n                        Toast.makeText(getApplicationContext(), \"点击了重试\", Toast.LENGTH_SHORT).show();\n                    }\n      });\n```\n\n## 可以 自定义 加载中，加载失败，加载为空 布局 实现自己加载效果\n###  使用全部自定义布局\n```\npublic class App extends Application {\n\n    @Override\n    public void onCreate() {\n        super.onCreate();\n            LoadViewHelper.getBuilder()\n                .setLoadEmpty(R.layout.this_empty)\n                .setLoadError(R.layout.this_error)\n                .setLoadIng(R.layout.this_load_ing);\n    }\n}\n```\n\n### 使用局部自定义布局\n```\n  helper.setLoadEmpty(view)\n  helper.setLoadEmpty(resId);\n  helper.getLoadIng(view);\n  helper.getLoadIng(resId);\n ```\n\n\n\n\n![](images/ssssssss.gif)\n\n\n### 更新日志\n\n  #### 1.1.2\n   * 1.修复点击重试出现一直处于loading中.\n  #### 1.1.0 \n   * 1.优化内部处理，代码更简洁 .\n   * 1.增加谈出谈入效果。  \n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyangchaojiang%2Fdemoloadview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyangchaojiang%2Fdemoloadview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyangchaojiang%2Fdemoloadview/lists"}