idanatz / OneAdapter

A Viewholderless Adapter for RecyclerView, who supports builtin diffing, states (paging, empty...), events (clicking, swiping...), and more.
MIT License
470 stars 45 forks source link

Load more animation when submit empty list #43

Closed vellrya closed 1 year ago

vellrya commented 3 years ago

Hello, in version 2.1.1 there is load more intermediate progress bar when calling oneAdapter.setItems(listOf()) or oneAdapter.clear() if adapter has items previously.

For example, I call this method in swipeRefreshLayout.setOnRefreshListener to clear previously loaded items (and clear onLoadMore with error), then I get two circle animation: one from swipeRefreshLayout, another one from OneAdapter - this looks bad. image

Probably adapter should not try to load more items, if empty list submitted?

idanatz commented 3 years ago

Hey again,

It's a side effect due to a previous bug (https://github.com/ironSource/OneAdapter/issues/41) Now, after each data submission, the paging logic is verified. When submitting an empty list the threshold actually is reached as 0 under it, but I agree that it's not that intuitive and should not happen. Will be fixed in the next version as a hotfix in the next couple of days.

Thanks for your help with identifying these issues!