{"id":13642424,"url":"https://github.com/nguyenhoanglam/ProgressLayout","last_synced_at":"2025-04-20T16:32:15.077Z","repository":{"id":128871186,"uuid":"67781043","full_name":"nguyenhoanglam/ProgressLayout","owner":"nguyenhoanglam","description":"An extension of RelativeLayout that helps show loading, empty and error layout.","archived":false,"fork":false,"pushed_at":"2020-07-01T08:40:57.000Z","size":122,"stargazers_count":107,"open_issues_count":1,"forks_count":19,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-09T13:38:47.416Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/nguyenhoanglam.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-09-09T08:27:31.000Z","updated_at":"2024-11-02T04:47:45.000Z","dependencies_parsed_at":"2023-07-04T16:32:39.144Z","dependency_job_id":null,"html_url":"https://github.com/nguyenhoanglam/ProgressLayout","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nguyenhoanglam%2FProgressLayout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nguyenhoanglam%2FProgressLayout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nguyenhoanglam%2FProgressLayout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nguyenhoanglam%2FProgressLayout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nguyenhoanglam","download_url":"https://codeload.github.com/nguyenhoanglam/ProgressLayout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249926346,"owners_count":21346542,"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:31.200Z","updated_at":"2025-04-20T16:32:14.764Z","avatar_url":"https://github.com/nguyenhoanglam.png","language":"Java","readme":"## ProgressLayout\nAn extension of RelativeLayout that helps show loading, empty and error layout.\n\n## Screenshot\n\u003cimg src=\"https://cloud.githubusercontent.com/assets/4979755/18380044/bab54c72-769f-11e6-8427-cdf6d3920b1c.png\" height=\"683\" width=\"384\"\u003e\n\u003cimg src=\"https://cloud.githubusercontent.com/assets/4979755/18380045/bb1fb300-769f-11e6-89b1-5fd3742385f1.png\" height=\"683\" width=\"384\"\u003e\n\u003cimg src=\"https://cloud.githubusercontent.com/assets/4979755/18380046/bb5f49a2-769f-11e6-8112-0f46b8c0d526.png\" height=\"683\" width=\"384\"\u003e\n## Download\nAdd to your module's build.gradle:\n\n```java\nallprojects {\n    repositories {\n        maven { url \"https://jitpack.io\" }\n    }\n}\n```\nand:\n\n```java\ndependencies {\n    compile 'com.github.nguyenhoanglam:ProgressLayout:1.0.0'\n}\n```\n\n## How to use \n- Use ProgressLayout like RelativeLayout in xml file.\n\n```java\n@Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);\n        toolbar.setTitle(\"Progress Layout\");\n        ProgressLayout progressLayout = (ProgressLayout) findViewById(R.id.progressLayout);\n        // Show progress layout and keep main views visible\n        // skipIds is a list of view's ids which you want to show with ProgressLayout (in this case is the Toobar)\n        List\u003cInteger\u003e skipIds = new ArrayList\u003c\u003e();\n        skipIds.add(R.id.toolbar);\n        progressLayout.showLoading(skipIds);\n        progressLayout.showEmpty(ContextCompat.getDrawable(this, R.drawable.ic_empty), \"Empty data\",skipIds);\n        progressLayout.showError(ContextCompat.getDrawable(this, R.drawable.ic_no_connection), \"No connection\", \"RETRY\", new View.OnClickListener() {\n            @Override\n            public void onClick(View view) {\n                Toast.makeText(MainActivity.this, \"Reloading...\", Toast.LENGTH_SHORT).show();\n            }\n        },skipIds);\n        // Show progress layout, hide all main views\n        progressLayout.showLoading();\n        progressLayout.showEmpty(ContextCompat.getDrawable(this, R.drawable.ic_empty), \"Empty data\");\n        progressLayout.showError(ContextCompat.getDrawable(this, R.drawable.ic_no_connection), \"No connection\", \"RETRY\", new View.OnClickListener() {\n            @Override\n            public void onClick(View view) {\n                Toast.makeText(MainActivity.this, \"Reloading...\", Toast.LENGTH_SHORT).show();\n            }\n        });\n    }\n```\n\n- Custom ProgressLayout's attributes\n\n```java\n\u003ccom.nguyenhoanglam.progresslayout.ProgressLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    android:id=\"@+id/progressLayout\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    app:emptyContentTextColor=\"@color/grey\"\n    app:emptyContentTextSize=\"14sp\"\n    app:emptyImageHeight=\"200dp\"\n    app:emptyImageWidth=\"2000dp\"\n    app:errorButtonTextColor=\"@color/teal\"\n    app:errorButtonTextSize=\"14sp\"\n    app:errorContentTextColor=\"@color/grey\"\n    app:errorContentTextSize=\"14sp\"\n    app:errorImageHeight=\"200dp\"\n    app:errorImageWidth=\"200dp\"\n    app:loadingProgressBarColor=\"@color/teal\"\n    app:loadingProgressBarRadius=\"100dp\"\n    app:loadingProgressBarSpinWidth=\"8dp\"/\u003e\n```\n\n##License\nCopyright 2016 Nguyen Hoang Lam\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n","funding_links":[],"categories":["空白页"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnguyenhoanglam%2FProgressLayout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnguyenhoanglam%2FProgressLayout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnguyenhoanglam%2FProgressLayout/lists"}