百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
P

pull-to-make-soup

> 编程语言
开源

可轻松添加到 RecyclerView 中的自定义动画式拉动刷新功能

1.4K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

可轻松添加到 RecyclerView 中的自定义动画式拉动刷新功能

PullToMakeSoup

可轻松添加到 RecyclerView 中的自定义动画式拉动刷新功能 受到 [dribble 上的这个项目] (https://dribbble.com/shots/2074667-Recipe-Finder-v-2) 的启发

要求

最低 SDK 版本为 16

使用 Gradle 安装

在您的项目级 build.gradle 中

groovy
 	allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

在您的 app 级 build.gradle 中

groovy
 compile 'com.github.Yalantis:pull-to-make-soup:1.0.2'

使用方法

将该库包含在本地库项目中。 第二步,将 PullToRefreshView 添加到布局中,并设置 app:type="soup"

xml
<com.yalantis.pulltomakesoup.PullToRefreshView
    android:id="@+id/pull_to_refresh"
    app:type="soup"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.v7.widget.RecyclerView
        android:id="@+id/recycler_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:divider="@null"
        android:dividerHeight="0dp"
        android:fadingEdge="none"/>

</com.yalantis.pulltomakesoup.PullToRefreshView>

在 onCreate 方法中,请参考 View 并设置 OnRefreshListener。

java
mPullToRefreshView = (PullToRefreshView) findViewById(R.id.pull_to_refresh);
mPullToRefreshView.setOnRefreshListener(new PullToRefreshView.OnRefreshListener() {
    @Override
    public void onRefresh() {}
});

当您需要完成刷新呼叫时

java
mPullToRefreshView.setRefreshing(false);

其他

如果需要更改进度状态:

java
	mPullToRefreshView.setRefreshing(boolean isRefreshing)

兼容性

  • Android JELLY BEAN 4.1+

版本: 1.0

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Javaandroidanimationjavapull-to-refresh

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言