{"id":17982640,"url":"https://github.com/sunzxyong/pulltoload","last_synced_at":"2025-03-25T19:31:34.054Z","repository":{"id":84636797,"uuid":"97789959","full_name":"Sunzxyong/PullToLoad","owner":"Sunzxyong","description":"a refresh framework supports any view and multiple nested views, and contains the wrapper which can load more.","archived":false,"fork":false,"pushed_at":"2017-08-04T04:40:28.000Z","size":1072,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-20T17:38:13.772Z","etag":null,"topics":["loadmore","pull-to-load","refresh","refreshlayout"],"latest_commit_sha":null,"homepage":"","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/Sunzxyong.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":"2017-07-20T04:19:12.000Z","updated_at":"2020-05-28T07:33:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"9e3e63cd-6550-4d54-bc3b-b05193c19b03","html_url":"https://github.com/Sunzxyong/PullToLoad","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/Sunzxyong%2FPullToLoad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sunzxyong%2FPullToLoad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sunzxyong%2FPullToLoad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sunzxyong%2FPullToLoad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sunzxyong","download_url":"https://codeload.github.com/Sunzxyong/PullToLoad/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245530240,"owners_count":20630514,"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":["loadmore","pull-to-load","refresh","refreshlayout"],"created_at":"2024-10-29T18:14:41.300Z","updated_at":"2025-03-25T19:31:34.047Z","avatar_url":"https://github.com/Sunzxyong.png","language":"Java","readme":"# **PullToLoad**\na refresh framework supports any view and multiple nested views, and contains the wrapper which can load more. \n\n----\n\n[ ![Download](https://api.bintray.com/packages/sunzxyong/maven/PullToLoad/images/download.svg) ](https://bintray.com/sunzxyong/maven/PullToLoad/_latestVersion)[![Travis](https://img.shields.io/travis/rust-lang/rust.svg)]() [![Hex.pm](https://img.shields.io/hexpm/l/plug.svg)]() ![](https://img.shields.io/badge/library-lightweight-yellow.svg)\n\n## **Usage**\n\n### **Effect**\n![](https://github.com/Sunzxyong/pull-to-load/blob/master/art/refresh_2.gif)\n![](https://github.com/Sunzxyong/pull-to-load/blob/master/art/refresh_3.gif)\n\nFor more effect see [Art](https://github.com/Sunzxyong/pull-to-load/tree/master/art).\n### **Installation**\n\n```\n    compile 'com.zxy.android:pull-to-load:1.0.0'\n```\n\n### **Refresh**\n\n```\n    \u003ccom.zxy.android.pulltoload.refresh.PullToRefreshLayout\n        android:id=\"@+id/refresh_layout\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\u003e\n\n        //refresh content.\n\n    \u003c/com.zxy.android.pulltoload.refresh.PullToRefreshLayout\u003e\n```\n\n**PullToRefreshLayout** provides many methods can be used.\n\n```\n\nsetRefresh(boolean refresh);//the current status.\nsetRefreshListener(OnRefreshListener refreshListener);//the refresh listener.\naddRefreshStateListener(OnRefreshStateListener refreshStateListener);//the refresh status callback,[PREPARE,READY,REFRESHING,FINISH].\nsetChildScrollUpCallback(OnChildScrollUpCallback childScrollUpCallback);//whether the current view can scroll up, used to trigger the refresh.\n\nsetRefreshHeight(int height);//refresh view height.\nsetRefreshContainerBackground(int color);//refresh view bg.\nisRefreshing();//is refreshing.\ngetRefreshState();//get refresh status.\nsetDampFactor(float factor);//set pull-down damp factor.\n\nsetRefreshView(View view);//Set up a fixed refresh the view.\n\n//set each state to refresh the view.\nsetOnPrepareView(View view);\nsetOnReadyView(View view);\nsetOnRefreshingView(View view);\nsetOnFinishView(View view);\n```\n\n### **LoadMore**\n\n`PullToLoad` framework provides `wrapper` for `RecyclerView` which can load more.\n\nYou don't need to change anything of your code, just need to use `RecyclerViewAdapterWrapper` wrap your adapter, like this：\n\n```\n        MyRecyclerViewAdapter realAdapter = new MyRecyclerViewAdapter();\n        RecyclerViewAdapterWrapper loadMoreWrapper = new RecyclerViewAdapterWrapper(realAdapter);\n        mRecyclerView.setAdapter(loadMoreWrapper);\n```\n\n`RecyclerViewAdapterWrapper` provides many methods can be used.\n\n```\nsetOnLoadMoreListener(OnLoadMoreListener listener);//listen to load more status.\n\nsetupNoMoreDataStatus();//use this if there is no more data.\nsetupHasMoreDataStatus();//use this if there is have more data.\nsetupLoadFailedStatus();//use this if there load more failed.\n\nsetLoadMoreView(View view);//custom load more view.\nsetNoMoreView(View view);//custom no more data view.\n```\n\nThe Effect:\n\n![](https://github.com/Sunzxyong/pull-to-load/blob/master/art/loadmore.gif)\n\n## **Version**\n* **v1.0.0**:The first version.\n\n## **License**\n\n\u003e\n\u003e     Apache License\n\u003e\n\u003e     Version 2.0, January 2004\n\u003e     http://www.apache.org/licenses/\n\u003e\n\u003e     Copyright 2017 郑晓勇\n\u003e\n\u003e  Licensed under the Apache License, Version 2.0 (the \"License\");\n\u003e  you may not use this file except in compliance with the License.\n\u003e  You may obtain a copy of the License at\n\u003e\n\u003e      http://www.apache.org/licenses/LICENSE-2.0\n\u003e\n\u003e  Unless required by applicable law or agreed to in writing, software\n\u003e  distributed under the License is distributed on an \"AS IS\" BASIS,\n\u003e  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\u003e  See the License for the specific language governing permissions and\n\u003e  limitations under the License. \n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunzxyong%2Fpulltoload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsunzxyong%2Fpulltoload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunzxyong%2Fpulltoload/lists"}