scwang90 / SmartRefreshLayout

🔥下拉刷新、上拉加载、二级刷新、淘宝二楼、RefreshLayout、OverScroll,Android智能下拉刷新框架,支持越界回弹、越界拖动,具有极强的扩展性,集成了几十种炫酷的Header和 Footer。
https://segmentfault.com/a/1190000010066071
Apache License 2.0
24.95k stars 4.96k forks source link

设置setEnableFooterFollowWhenNoMoreData脚布局问题 #1528

Closed xuzhu19930323 closed 1 week ago

xuzhu19930323 commented 1 year ago

使用库的版本号为:1.1.0-alpha-21@aar

当数据只有2条时,footer没有更多出不来,当数据达到6条时没有更多才展示出来

示例代码: refresh_layout.apply { setRefreshHeader(BinanceRefreshHeader(requireActivity())) setRefreshFooter(LocalRefreshFooter(requireActivity()).apply { setDefaultText() }) setOnRefreshListener { refreshData(true) } setOnLoadMoreListener { refreshData(false) } setEnableLoadMoreWhenContentNotFull(false) setEnableFooterFollowWhenNoMoreData(true) autoRefresh() }

private fun stopLoadingAndRefresh() { refresh_layout.let { it.finishRefresh() if (adapter.list.size < page * adapter.pageSize) { it.finishLoadMoreWithNoMoreData() } else { it.finishLoadMore() } } }

scwang90 commented 1 week ago

参考 demo 中的 示例: 首页-使用-NoMoreData