You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when i load more data,between last data of refresh and first data of loadmore has no divider,then i scroll the recycleview ,then divider has show,why
#60
Open
wei7785929 opened this issue
Sep 4, 2018
· 1 comment
RecyclerView-FlexibleDivider builder set showLastDivider to false by default,so the last item will have no divider. When app load more data, you called notifyItemRangedInserted and the item which has no divider will not be invalidated.
to fix the problem, here is my suggestions:
call notifyDatasetChanged when load more data to ensure all items are invalidated
build divider with showLastDivider
new HorizontalDividerItemDecoration.Builder(this).showLastDivider().build());
call notifyItemChanged() to invalidate the item which has no divider
final int last = adapter.getItemCount() - 1;
// adaper.notifyItemRangeInserted(last, list.size());
adapter.notifyItemChanged(last);
No description provided.
The text was updated successfully, but these errors were encountered: