Open niharika2810 opened 3 years ago
Hello @niharika2810 , I think there is a typo mistake in the issue description. architectural patetr
Hey Thanks, correcting it.
Hello, @niharika2810 the footer(or header) Progress bar from the paginated data is keep on loading even though the network call is completed and the error message is displayed.
we can fix this by showing the progress bar only when the state is loading in the LoadStateViewHolder like this .
binding.progress.isVisible = loadState is LoadState.Loading
instead of binding.progress.isVisible = loadState !is LoadState.Loading
This is Fixed
Hello, @niharika2810 there is no retry option or any button to retry if the data is empty or if it's the first time the user has opened and without an internet connection so the user won't get any data from the DB or from the network so I think there has to be a retry option or some kind of message.
for this we can add a loadstatelistener for the adapter in the both fragments and check the data and we can show the empty layout like this.
adapter.addLoadStateListener { binding.apply { if(it.source.append.endOfPaginationReached && it.source.refresh is LoadState.Loading && adapter.itemCount<1){ photosRecyclerview.isVisible=false textViewEmpty.isVisible=true }else{ textViewEmpty.isVisible=false } } }
This is Fixed
The app is built in Kotlin with the architectural pattern, dependency injection and Navigation component integrated.
Run the app -> try to find issues -> Write down the steps to reproduce -> Propose a solution for the issue