Open sockeqwe opened 7 years ago
private void renderShowData(HomeViewState state) {
TransitionManager.beginDelayedTransition((ViewGroup) getView());
loadingView.setVisibility(View.GONE);
errorView.setVisibility(View.GONE);
swipeRefreshLayout.setVisibility(View.VISIBLE);
boolean changed = adapter.setLoadingNextPage(state.isLoadingNextPage()); // TODO: Internally calls items.size() which is null on orientation change!
if (changed && state.isLoadingNextPage()) {
// scroll to the end of the list so that the user sees the load more progress bar
recyclerView.smoothScrollToPosition(adapter.getItemCount());
}
adapter.setItems(state.getData());
// TODO: this must be done before setLoading() otherwise error will occure. see https://github.com/sockeqwe/mosby/issues/244
While loading more items (pagination on home screen) and switch from portrait to landscape.
Logs: