captain-miao / RecyclerViewUtils

[DEPRECATED] // RecyclerView Utils:refresh,load more,sticky header,expand,index
276 stars 68 forks source link

addAll method update for twice #34

Closed chenfgit closed 6 years ago

chenfgit commented 6 years ago

public void addAll(List list, boolean notifyDataChange) { if (list == null || list.isEmpty()) { return; } mItemList.addAll(list); //(1) if(notifyDataChange) { try { notifyItemRangeInserted(mHeaderSize + getBasicItemCount(), list.size());//(2) } catch (Exception e) { Log.w(TAG, "notifyItemRangeInserted failure"); e.printStackTrace(); notifyDataSetChanged(); } notifyDataSetChanged(); } }

in addAll method, after notifyItemRangeInserted method ,call notifyDataSetChanged is redundant.