diff --git a/library/src/main/java/com/chad/library/adapter/base/BaseQuickAdapter.java b/library/src/main/java/com/chad/library/adapter/base/BaseQuickAdapter.java index 3d19a7898..786b7065c 100755 --- a/library/src/main/java/com/chad/library/adapter/base/BaseQuickAdapter.java +++ b/library/src/main/java/com/chad/library/adapter/base/BaseQuickAdapter.java @@ -209,7 +209,7 @@ public void add(int position, T item) { * @param data */ public void setNewData(List data) { - this.mData = data; + this.mData = data == null ? new ArrayList() : data; if (mRequestLoadMoreListener != null) { mNextLoadEnable = true; // mFooterLayout = null; @@ -223,6 +223,7 @@ public void setNewData(List data) { /** * add one new data in to certain location + * * @param position */ public void addData(int position, T data) { @@ -237,6 +238,7 @@ public void addData(int position, T data) { /** * add new data in to certain location + * * @param position */ public void addData(int position, List data) { @@ -1103,9 +1105,10 @@ public int expandAll(int position, boolean animate, boolean notify) { /** * expand the item and all its subItems + * * @param position position of the item, which includes the header layout count. - * @param init whether you are initializing the recyclerView or not. - * if true, it won't notify recyclerView to redraw UI. + * @param init whether you are initializing the recyclerView or not. + * if true, it won't notify recyclerView to redraw UI. * @return the number of items that have been added to the adapter. */ public int expandAll(int position, boolean init) { @@ -1141,8 +1144,8 @@ private int recursiveCollapse(@IntRange(from = 0) int position) { * Collapse an expandable item that has been expanded.. * * @param position the position of the item, which includes the header layout count. - * @param animate collapse with animation or not. - * @param notify notify the recyclerView refresh UI or not. + * @param animate collapse with animation or not. + * @param notify notify the recyclerView refresh UI or not. * @return the number of subItems collapsed. */ public int collapse(@IntRange(from = 0) int position, boolean animate, boolean notify) { @@ -1202,7 +1205,7 @@ private boolean isExpandable(T item) { private IExpandable getExpandableItem(int position) { T item = getItem(position); if (isExpandable(item)) { - return (IExpandable)item; + return (IExpandable) item; } else { return null; }