【发布时间】:2020-12-15 04:36:16
【问题描述】:
我已按照教程将 Loadstate Adapter 添加到 Android Paging 3 上的 Recyclerview 适配器,但目前未显示。这就是我更新适配器的方式。
lifecycleScope.launch {
viewModel.searchProducts(searchParam, channelId, categoryId)
.collectLatest {
binding.allProductRecyclerView.isVisible = true
adapter.submitData(it)
}
这就是我添加 LoadState 适配器的方式
binding.allProductRecyclerView.adapter = adapter.withLoadStateFooter(
footer = ProductLoadingStateAdapter()
)
This is the gist of LoadStateAdapter 还有Activity Layout 和load state Item
适配器工作正常,我还可以通过添加 LoadStateListener 来获取负载状态。只有负载状态适配器不工作。我已经关注并克隆了this,它运行良好。我的可能是什么问题?
【问题讨论】:
-
你找到解决办法了吗?
-
你找到解决方法了吗,我也有同样的问题
标签: android android-paging android-paging-library android-paging-3