{"id":16558712,"url":"https://github.com/pengmaster/multiplelayout","last_synced_at":"2026-03-16T13:44:18.249Z","repository":{"id":143248571,"uuid":"152353003","full_name":"pengMaster/MultipleLayout","owner":"pengMaster","description":":wheelchair: 最简单的状态切换布局","archived":false,"fork":false,"pushed_at":"2018-10-17T02:05:16.000Z","size":151,"stargazers_count":40,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T00:46:07.311Z","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/pengMaster.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,"publiccode":null,"codemeta":null}},"created_at":"2018-10-10T02:44:46.000Z","updated_at":"2023-05-06T02:28:46.000Z","dependencies_parsed_at":"2023-06-29T19:46:31.027Z","dependency_job_id":null,"html_url":"https://github.com/pengMaster/MultipleLayout","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/pengMaster%2FMultipleLayout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pengMaster%2FMultipleLayout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pengMaster%2FMultipleLayout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pengMaster%2FMultipleLayout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pengMaster","download_url":"https://codeload.github.com/pengMaster/MultipleLayout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244790748,"owners_count":20510801,"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-10-11T20:23:32.063Z","updated_at":"2026-03-16T13:44:13.210Z","avatar_url":"https://github.com/pengMaster.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003ch1 align=\"center\"\u003e最简单的状态切换布局\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"README.md\"\u003e\n    \u003cb\u003e英文说明\u003c/b\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n### 功能简介\n\n - 正在加载数据\n - 数据加载失败\n - 数据加载为空\n - 网络加载失败\n - 重试点击事件\n - 支持自定义布局\n\n\n### 效果图展示\n\u003cdiv \u003e\n    \u003cimg src=\"https://github.com/pengMaster/picApplyGit/blob/master/MultipleLayout/device-2018-10-10-104939.png\" width=\"150\" height=\"250\"  alt=\"\"/\u003e\n    \u003cimg src=\"https://github.com/pengMaster/picApplyGit/blob/master/MultipleLayout/device-2018-10-10-105002.png\" width=\"150\" height=\"250\"  alt=\"\"/\u003e\n    \u003cimg src=\"https://github.com/pengMaster/picApplyGit/blob/master/MultipleLayout/device-2018-10-10-105048.png\" width=\"150\" height=\"250\"  alt=\"\"/\u003e\n    \u003cimg src=\"https://github.com/pengMaster/picApplyGit/blob/master/MultipleLayout/device-2018-10-10-105101.png\" width=\"150\" height=\"250\" alt=\"\"/\u003e\n    \u003cimg src=\"https://github.com/pengMaster/picApplyGit/blob/master/MultipleLayout/device-2018-10-10-105112.png\" width=\"150\" height=\"250\"  alt=\"\"/\u003e\n   \u003cimg src=\"https://github.com/pengMaster/picApplyGit/blob/master/MultipleLayout/device-2018-10-10-105126.png\" width=\"150\" height=\"250\"  alt=\"\"/\u003e\n\u003c/div\u003e\n\n\n\n### 最简单的使用方式\n\n1.Add it in your root build.gradle at the end of repositories:\n\n```java\nallprojects {\n\t\trepositories {\n\t\t\t...\n\t\t\tmaven { url 'https://jitpack.io' }\n\t\t}\n\t}\n\n```\n\n2.Add the dependency\n\n```java\n\tdependencies {\n\t        implementation 'com.github.pengMaster:MultipleLayout:1.0.0'\n\t}\n\n```\n3.在布局中添加\n\n```java\n\n    \u003cking.bird.multipleview.MultipleLayout\n        android:id=\"@+id/mMultipleLayout\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\u003e\n\n        \u003c!--任意内容--\u003e\n        \u003cTextView\n            android:id=\"@+id/mTvContent\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_centerInParent=\"true\"\n            android:text=\"@string/content\" /\u003e\n\n    \u003c/king.bird.multipleview.MultipleLayout\u003e\n\n\n```\n```\n 注意： MultipleLayout 可做为没有标题栏的最外层布局，内部可包裹任何内容\n```\n\n4.代码中使用\n\n```java\n        //重试点击事件\n        mMultipleLayout.setOnRetryClickListener {\n            //模拟网络请求\n            Toast.makeText(this@MainActivity,\"正在加载。。\",Toast.LENGTH_SHORT).show()\n        }\n        //数据为空\n        mMultipleLayout.showEmpty()\n        //加载失败\n        mMultipleLayout.showError()\n        //正在加载\n        mMultipleLayout.showLoading()\n        //网络加载失败\n        mMultipleLayout.showNoNetwork()\n        //显示内容\n        mMultipleLayout.showContent()\n\n\n```\n\n\n### 扩展功能\n\n1.自定义状态布局\n\n```java\n    \u003cking.bird.multipleview.MultipleLayout\n        android:id=\"@+id/multipleStatusView\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        \u003c!--自定义布局--\u003e\n        app:emptyView=\"@layout/layout_empty_view\"\n        app:errorView=\"@layout/layout_error_view\"\n        app:loadingView=\"@layout/layout_loading_view\"\n        app:noNetworkView=\"@layout/layout_network_view\"\u003e\n\n    \u003c/king.bird.multipleview.MultipleLayout\u003e\n```\n\n2.代码引入布局\n\n```java\n        //数据为空\n        showEmpty(int layoutId, ViewGroup.LayoutParams layoutParams)\n        showEmpty(View view, ViewGroup.LayoutParams layoutParams)\n        //加载失败\n        showError(int layoutId, ViewGroup.LayoutParams layoutParams)\n        showError(View view, ViewGroup.LayoutParams layoutParams)\n        //正在加载\n        showLoading(int layoutId, ViewGroup.LayoutParams layoutParams)\n        showLoading(View view, ViewGroup.LayoutParams layoutParams)\n        //网络加载失败\n        void showNoNetwork(int layoutId, ViewGroup.LayoutParams layoutParams)\n        showNoNetwork(View view, ViewGroup.LayoutParams layoutParams)\n\n```\n3.扩展\n```\n后续添加各种弹框\n```\n\n### 参与贡献\n\n1. Fork 本项目\n2. 新建 Feat_xxx 分支\n3. 提交代码\n4. 新建 Pull Request\n\n\n### github地址\n\n - 项目地址：https://github.com/pengMaster/MultipleLayout\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpengmaster%2Fmultiplelayout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpengmaster%2Fmultiplelayout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpengmaster%2Fmultiplelayout/lists"}