From 5168f741ae212ab38d7197e878f0c919e38baa0e Mon Sep 17 00:00:00 2001 From: humazed Date: Mon, 15 Jan 2018 17:46:08 +0200 Subject: [PATCH 1/2] update gradle build tools to v3.0.1 --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 28cacc2eb..0ee3ea27e 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.0.0' + classpath 'com.android.tools.build:gradle:3.0.1' } } From 77317cf9e2c988cca4052e8280662fd23cf57199 Mon Sep 17 00:00:00 2001 From: humazed Date: Mon, 15 Jan 2018 17:47:28 +0200 Subject: [PATCH 2/2] fixed the issue #1928 regarding onItemSwiped callback. --- .../library/adapter/base/BaseItemDraggableAdapter.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/src/main/java/com/chad/library/adapter/base/BaseItemDraggableAdapter.java b/library/src/main/java/com/chad/library/adapter/base/BaseItemDraggableAdapter.java index 60cda21f6..8d1ddaa15 100644 --- a/library/src/main/java/com/chad/library/adapter/base/BaseItemDraggableAdapter.java +++ b/library/src/main/java/com/chad/library/adapter/base/BaseItemDraggableAdapter.java @@ -239,16 +239,16 @@ public void onItemSwipeClear(RecyclerView.ViewHolder viewHolder) { } public void onItemSwiped(RecyclerView.ViewHolder viewHolder) { - if (mOnItemSwipeListener != null && itemSwipeEnabled) { - mOnItemSwipeListener.onItemSwiped(viewHolder, getViewHolderPosition(viewHolder)); - } - int pos = getViewHolderPosition(viewHolder); if (inRange(pos)) { mData.remove(pos); notifyItemRemoved(viewHolder.getAdapterPosition()); } + + if (mOnItemSwipeListener != null && itemSwipeEnabled) { + mOnItemSwipeListener.onItemSwiped(viewHolder, getViewHolderPosition(viewHolder)); + } } public void onItemSwiping(Canvas canvas, RecyclerView.ViewHolder viewHolder, float dX, float dY, boolean isCurrentlyActive) {