Android Paging 3 doesnt show Loadstate Adapter

I have followed a tutorial to add Loadstate Adapter to the Recyclerview Adapter on Android Paging 3 but currently, it’s not showing. This is how I am updating the Adapter.

 lifecycleScope.launch {
            viewModel.searchProducts(searchParam, channelId, categoryId)
                .collectLatest {
                    binding.allProductRecyclerView.isVisible = true
                    adapter.submitData(it)
                }
        

This is how I am adding the LoadState Adapter

  binding.allProductRecyclerView.adapter = adapter.withLoadStateFooter(
        footer = ProductLoadingStateAdapter()
    )

This is the gist of LoadStateAdapter alsoActivity Layout and load state Item

The adapter is working fine, I am also able to get the load states by adding LoadStateListener. It’s only the Load State Adapter that isn’t working. I have followed and cloned this and it’s working perfectly. What might be the issue with mine?

Source: Android Questions

One Reply to “Android Paging 3 doesnt show Loadstate Adapter”

LEAVE A COMMENT