{"id":13396009,"url":"https://github.com/baoyongzhang/android-PullRefreshLayout","last_synced_at":"2025-03-13T22:31:32.261Z","repository":{"id":22703089,"uuid":"26047095","full_name":"baoyongzhang/android-PullRefreshLayout","owner":"baoyongzhang","description":"This component like SwipeRefreshLayout, it is more beautiful than SwipeRefreshLayout.","archived":false,"fork":false,"pushed_at":"2024-04-02T09:44:47.000Z","size":2757,"stargazers_count":2062,"open_issues_count":36,"forks_count":515,"subscribers_count":78,"default_branch":"master","last_synced_at":"2024-10-29T17:43:30.315Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/baoyongzhang.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-11-01T09:50:10.000Z","updated_at":"2024-10-18T14:34:47.000Z","dependencies_parsed_at":"2024-10-25T12:47:11.512Z","dependency_job_id":"e3d44150-0580-4dc2-a57d-ab8c1d9fa33f","html_url":"https://github.com/baoyongzhang/android-PullRefreshLayout","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baoyongzhang%2Fandroid-PullRefreshLayout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baoyongzhang%2Fandroid-PullRefreshLayout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baoyongzhang%2Fandroid-PullRefreshLayout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baoyongzhang%2Fandroid-PullRefreshLayout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/baoyongzhang","download_url":"https://codeload.github.com/baoyongzhang/android-PullRefreshLayout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243493702,"owners_count":20299705,"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-07-30T18:00:37.585Z","updated_at":"2025-03-13T22:31:31.835Z","avatar_url":"https://github.com/baoyongzhang.png","language":"Java","readme":"android-PullRefreshLayout\n=========================\n\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-android--PullRefreshLayout-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/1084)\n\nThis component like SwipeRefreshLayout, it is more beautiful than SwipeRefreshLayout.\n\n# Demo\n\u003cp\u003e\n   \u003cimg src=\"https://raw.githubusercontent.com/baoyongzhang/android-PullRefreshLayout/master/demo.gif\" width=\"320\" alt=\"Screenshot\"/\u003e\n\u003c/p\u003e\n\n# Usage\n\nAdd dependency.\n\n```\ndependencies {\n    compile 'com.baoyz.pullrefreshlayout:library:1.2.0'\n}\n```\n\nUse method like SwipeRefreshLayout's usage.  \n\nUse it in your layout xml.\n\n```xml \n\u003ccom.baoyz.widget.PullRefreshLayout\n    android:id=\"@+id/swipeRefreshLayout\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\u003e\n\n\t\u003c!-- ListView、ScrollView、RecyclerView、Other --\u003e\n\t\n\u003c/com.baoyz.widget.PullRefreshLayout\u003e\n\n```\n\nGet instance and use it.\n\n```java\nPullRefreshLayout layout = (PullRefreshLayout) findViewById(...);\n\n// listen refresh event\nlayout.setOnRefreshListener(new PullRefreshLayout.OnRefreshListener() {\n    @Override\n    public void onRefresh() {\n        // start refresh\n    }\n});\n\n// refresh complete \nlayout.setRefreshing(false);\n\n```\n\nChange the refresh style, there are five styles of use, `MATERIAL`、`CIRCLES`、 `WATER_DROP`、`RING` and `SMARTISAN`.  \n\nIn java, call `setRefreshStyle` method.\n\n```java\nlayout.setRefreshStyle(PullRefreshLayout.STYLE_CIRCLES);\n\n```\n\nIn xml, use attributes.\n\n```xml\n\u003ccom.baoyz.widget.PullRefreshLayout\n    android:id=\"@+id/swipeRefreshLayout\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n\tapp:refreshType=\"water_drop\"\u003e\n\t\n\u003c/com.baoyz.widget.PullRefreshLayout\u003e\n\n```\n \nChange the color scheme.\nIn java, call `setColorSchemeColors` method. The int array length must be 4.\n\n```java\nlayout.setColorSchemeColors(int []);\n\n```\n\nFor Smartisan style, it has only one color, can call 'setColor' method, to set one color.\n\n```java\nlayout.setColor(int);\n```\n\nIn xml, use attributes.\n\n```xml\n\u003ccom.baoyz.widget.PullRefreshLayout\n    android:id=\"@+id/swipeRefreshLayout\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    app:refreshColors=\"@array/scheme_colors\"\n    app:refreshColor=\"@color/one_color\"\u003e\n\t\n\u003c/com.baoyz.widget.PullRefreshLayout\u003e\n\n```\n\nIf you do not like these styles, you can customize the refresh style.\n\n```java\nclass CustomDrawable extends RefreshDrawable{\n\n    @Override\n    public void setPercent(float percent) {\n        // Percentage of the maximum distance of the drop-down refresh.\n    }\n\n    @Override\n    public void setColorSchemeColors(int[] colorSchemeColors) {\n        \n    }\n\n    @Override\n    public void offsetTopAndBottom(int offset) {\n        // Drop-down offset.\n    }\n\n    @Override\n    public void start() {\n        isRunning = true;\n        // Refresh started, start refresh animation.\n    }\n\n    @Override\n    public void stop() {\n        isRunning = false;\n        // Refresh completed, stop refresh animation.\n    }\n\n    @Override\n    public boolean isRunning() {\n        return isRunning;\n    }\n\n    @Override\n    public void draw(Canvas canvas) {\n        // Draw custom style.\n    }\n\n}\n\n```\n\nCall `setRefreshDrawable()` method to use your custom refresh drawable.\n\n```java\nlayout.setRefreshDrawable(new CustomDrawable());\n```\n\n# Thanks\n\n* [SwipeRefreshLayout](https://developer.android.com/reference/android/support/v4/widget/SwipeRefreshLayout.html)\n* [GoogleProgressBar](https://github.com/jpardogo/GoogleProgressBar) \n\nLicense\n=======\n\n    The MIT License (MIT)\n\n\tCopyright (c) 2014 baoyongzhang\n\n\tPermission is hereby granted, free of charge, to any person obtaining a copy\n\tof this software and associated documentation files (the \"Software\"), to deal\n\tin the Software without restriction, including without limitation the rights\n\tto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\tcopies of the Software, and to permit persons to whom the Software is\n\tfurnished to do so, subject to the following conditions:\n\n\tThe above copyright notice and this permission notice shall be included in all\n\tcopies or substantial portions of the Software.\n\n\tTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\tIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\tFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\tAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\tLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\tOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n\tSOFTWARE.\n\n\n","funding_links":[],"categories":["Index `(light-weight pages)`","Index","Libs"],"sub_categories":["\u003cA NAME=\"Widget\"\u003e\u003c/A\u003eWidget"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaoyongzhang%2Fandroid-PullRefreshLayout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaoyongzhang%2Fandroid-PullRefreshLayout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaoyongzhang%2Fandroid-PullRefreshLayout/lists"}