pull/78/head
kunfei 5 years ago
parent db36dbb8a0
commit 3fb4c256ad
  1. 11
      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) {

Loading…
Cancel
Save