From 3fb4c256ada39199721bc2f61619fb863f46b60e Mon Sep 17 00:00:00 2001 From: kunfei Date: Sat, 25 Jan 2020 21:39:28 +0800 Subject: [PATCH] up --- .../main/java/io/legado/app/help/ItemTouchCallback.kt | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/io/legado/app/help/ItemTouchCallback.kt b/app/src/main/java/io/legado/app/help/ItemTouchCallback.kt index 9cf1fccf5..5454b6e56 100644 --- a/app/src/main/java/io/legado/app/help/ItemTouchCallback.kt +++ b/app/src/main/java/io/legado/app/help/ItemTouchCallback.kt @@ -88,16 +88,13 @@ class ItemTouchCallback : ItemTouchHelper.Callback() { srcViewHolder: RecyclerView.ViewHolder, targetViewHolder: RecyclerView.ViewHolder ): Boolean { - onItemTouchCallbackListener?.let { - return it.onMove(srcViewHolder.adapterPosition, targetViewHolder.adapterPosition) - } - return false + return onItemTouchCallbackListener + ?.onMove(srcViewHolder.adapterPosition, targetViewHolder.adapterPosition) + ?: false } override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) { - onItemTouchCallbackListener?.let { - return it.onSwiped(viewHolder.adapterPosition) - } + onItemTouchCallbackListener?.onSwiped(viewHolder.adapterPosition) } override fun onSelectedChanged(viewHolder: RecyclerView.ViewHolder?, actionState: Int) {