代码拉取完成,页面将自动刷新
本项目是基于开源项目 JellyRefreshLayout 进行ohos化的移植和开发的,可以通过项目标签以及github地址( https://github.com/imallan/JellyRefreshLayout )追踪到原项目版本
编译har包JellyRefreshLayout_ohos.har。
启动 DevEco Studio,将har包导入工程目录“entry->libs”下。
在moudle级别下的build.gradle文件中添加依赖,在dependences标签中增加对libs目录下har包的引用。
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar', '*.har'])
……
}
在导入的har包上点击右键,选择“Add as Library”对包进行引用,选择需要引用的模块,并点击“OK”即引用成功。
repositories {
maven {
url 'http://106.15.92.248:8081/repository/Releases/'
}
}
dependencies {
implementation 'uk.co.imallan.ohos:JellyRefreshLayout:1.0.0'
}
有关该项目的业务实现,请参见“entry”文件夹.
<uk.co.imallan.jellyrefresh.JellyRefreshLayout
ohos:id="$+id:jelly_refresh"
ohos:height="match_parent"
ohos:width="match_parent"
ohos:text="Loading…"
app:jellyColor="#ff80cbc4"
app:pullHeight="160vp"
app:triggerHeight="108vp">
<ScrollView
ohos:height="match_parent"
ohos:width="match_parent">
.... // 此处的父布局也可以是 Listcontainer
</ScrollView>
</uk.co.imallan.jellyrefresh.JellyRefreshLayout>
mJellyLayout.setRefreshListener(new JellyRefreshLayout.JellyRefreshListener() {
@Override
public void onRefresh(final JellyRefreshLayout jellyRefreshLayout) {
// your code here
}
});
当你完成时,完成刷新
mJellyLayout.setRefreshing(false); // true 开始刷新
1.目前支持功能如下:
- 手动下拉刷新
- 触发刷新api即可刷新,例如点击一个按钮调用刷新效果
MIT License (MIT)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。