From 2c07860c9492de982896e0ba445f0b30e3fce51a Mon Sep 17 00:00:00 2001 From: chad <54050520@qq.com> Date: Sun, 16 Oct 2016 18:04:27 +0800 Subject: [PATCH] fix bug #354 --- .../chad/library/adapter/base/BaseQuickAdapter.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) 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 c71cdb62d..1a67d9a95 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 @@ -266,10 +266,8 @@ public void addData(int position, List data) { */ public void addData(List newData) { this.mData.addAll(newData); - if (mNextLoadEnable) { - mLoadingMoreEnable = false; - } - notifyItemRangeChanged(mData.size() - newData.size() + getHeaderLayoutCount(), newData.size()); + hiedLoadingMore(); + notifyItemRangeInserted(mData.size() - newData.size() + getHeaderLayoutCount(),newData.size()); } /** @@ -284,13 +282,11 @@ public boolean isLoading() { * same as addData(List) but for when data is manually added to the adapter */ public void dataAdded() { - if (mNextLoadEnable) { - mLoadingMoreEnable = false; - } + hiedLoadingMore(); notifyDataSetChanged(); } - public void nextData() { + public void hiedLoadingMore() { if (mNextLoadEnable) { mLoadingMoreEnable = false; }