{"id":13641525,"url":"https://github.com/linuxjava/HorizontalRefreshLayout","last_synced_at":"2025-04-20T11:31:17.395Z","repository":{"id":79069877,"uuid":"81810140","full_name":"linuxjava/HorizontalRefreshLayout","owner":"linuxjava","description":null,"archived":false,"fork":false,"pushed_at":"2017-02-15T08:56:05.000Z","size":17348,"stargazers_count":155,"open_issues_count":2,"forks_count":19,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-03T01:23:32.352Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linuxjava.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}},"created_at":"2017-02-13T09:56:58.000Z","updated_at":"2023-11-23T07:45:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"a2a3947f-953a-44ab-a8aa-81dcc81c912c","html_url":"https://github.com/linuxjava/HorizontalRefreshLayout","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/linuxjava%2FHorizontalRefreshLayout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuxjava%2FHorizontalRefreshLayout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuxjava%2FHorizontalRefreshLayout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuxjava%2FHorizontalRefreshLayout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linuxjava","download_url":"https://codeload.github.com/linuxjava/HorizontalRefreshLayout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223827375,"owners_count":17209782,"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:21.480Z","updated_at":"2024-11-09T12:30:24.711Z","avatar_url":"https://github.com/linuxjava.png","language":"Java","readme":":running:HorizontalRefreshLayout-Android:running:\n============\n\n开发者使用 HorizontalRefreshLayout-Android 可以对RecycView、Listview、ScrollView等控件实现左右刷新\n\n##  APK下载\n[Download](https://github.com/linuxjava/HorizontalRefreshLayout/raw/master/apk/app-debug.apk)\n##  Demo使用\n运行demo需删除gradle.properties中的代理\n```xml\nsystemProp.http.proxyHost=dev-proxy.oa.com\nsystemProp.http.proxyPort=8080\nsystemProp.https.proxyHost=dev-proxy.oa.com\nsystemProp.https.proxyPort=8080\n```\n## Gradle配置\ncompile 'xiao.free.horizontalrefreshlayout:lib:v0.1.2'\n## XML配置\n```xml\n\u003cxiao.free.horizontalrefreshlayout.HorizontalRefreshLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:id=\"@+id/refresh\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:background=\"@color/blue\"\u003e\n\n    \u003ccom.lsjwzh.widget.recyclerviewpager.RecyclerViewPager\n        android:id=\"@+id/viewpager\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:clipToPadding=\"false\"\n        app:rvp_flingFactor=\"0.15\"\n        app:rvp_singlePageFling=\"false\"\n        app:rvp_triggerOffset=\"0.5\" /\u003e\n\n\u003c/xiao.free.horizontalrefreshlayout.HorizontalRefreshLayout\u003e\n```\n## Java代码\n```java\nrefreshLayout = (HorizontalRefreshLayout) findViewById(R.id.refresh);\nrefreshLayout.setRefreshCallback(this);\nrefreshLayout.setRefreshHeader(new LoadingRefreshHeader(this), HorizontalRefreshLayout.LEFT);\nrefreshLayout.setRefreshHeader(new LoadingRefreshHeader(this), HorizontalRefreshLayout.RIGHT);\n```\n通过setRefreshHeader方法可以设置左右刷新头部，库中已支持三种刷新效果，如下图所示：\n\n![image](https://github.com/linuxjava/HorizontalRefreshLayout/raw/master/gif/1.gif) \n![image](https://github.com/linuxjava/HorizontalRefreshLayout/raw/master/gif/2.gif)\n![image](https://github.com/linuxjava/HorizontalRefreshLayout/raw/master/gif/3.gif)\n\n## 自定义Header\n可通过实现如下接口实现自定义header\n```java\npublic interface RefreshHeader {\n    /**\n     * @param dragPosition  HorizontalRefreshLayout.START or HorizontalRefreshLayout.END\n     */\n    void onStart(int dragPosition, View refreshHead);\n\n    /**\n     * @param distance\n     */\n    void onDragging(float distance, float percent, View refreshHead);\n\n    void onReadyToRelease(View refreshHead);\n\n    @NonNull View getView(ViewGroup container);\n\n    void onRefreshing(View refreshHead);\n}\n```\n具体可参考lib库中refreshhead目录中的实现\n","funding_links":[],"categories":["下拉刷新"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinuxjava%2FHorizontalRefreshLayout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinuxjava%2FHorizontalRefreshLayout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinuxjava%2FHorizontalRefreshLayout/lists"}