From 16f4a4b1efc48de0d68aebe58fbc5afdc153d916 Mon Sep 17 00:00:00 2001 From: SilenceDut Date: Tue, 29 Jan 2019 11:18:25 +0800 Subject: [PATCH] add clear method --- .../main/java/com/silencedut/diffadapter/DiffAdapter.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/diffadapter/src/main/java/com/silencedut/diffadapter/DiffAdapter.java b/diffadapter/src/main/java/com/silencedut/diffadapter/DiffAdapter.java index 74c27fd..6d05d85 100644 --- a/diffadapter/src/main/java/com/silencedut/diffadapter/DiffAdapter.java +++ b/diffadapter/src/main/java/com/silencedut/diffadapter/DiffAdapter.java @@ -199,7 +199,11 @@ public void setDatas(List datas) { mDifferHelper.submitList(newList); } + public void clear() { + mDifferHelper.submitList(null); + + } public void addData(final T data) { if (data == null) { @@ -215,7 +219,6 @@ public void run() { } },mDatas); - }