引入 implementation'com.jwenfeng.pulltorefresh:library:1.0.3'
val pu: PullToRefreshLayout = root.findViewById(R.id.pu)
pu.setMaxHeadHeight(5000)
pu.setMaxFootHeight(5000)
pu.setRefreshListener(object : BaseRefreshListener {
override fun refresh() {
pu.postDelayed(Runnable { //在这写上你要刷新的逻辑代码
pu.finishRefresh()
},1000)
}
override fun loadMore() {
pu.postDelayed(Runnable { //在这写上你要刷新的逻辑代码;
pu.finishLoadMore()
},1000)
}
})
pu.setAllHeight(5000,5000)