diff --git a/app/src/main/java/io/legado/app/ui/widget/recycler/ItemTouchCallback.kt b/app/src/main/java/io/legado/app/ui/widget/recycler/ItemTouchCallback.kt index 8c8a0d907..be45df2cf 100644 --- a/app/src/main/java/io/legado/app/ui/widget/recycler/ItemTouchCallback.kt +++ b/app/src/main/java/io/legado/app/ui/widget/recycler/ItemTouchCallback.kt @@ -86,8 +86,8 @@ class ItemTouchCallback(private val callback: Callback) : ItemTouchHelper.Callba srcViewHolder: RecyclerView.ViewHolder, targetViewHolder: RecyclerView.ViewHolder ): Boolean { - val fromPosition: Int = srcViewHolder.adapterPosition - val toPosition: Int = targetViewHolder.adapterPosition + val fromPosition: Int = srcViewHolder.bindingAdapterPosition + val toPosition: Int = targetViewHolder.bindingAdapterPosition if (fromPosition < toPosition) { for (i in fromPosition until toPosition) { callback.swap(i, i + 1) @@ -101,7 +101,7 @@ class ItemTouchCallback(private val callback: Callback) : ItemTouchHelper.Callba } override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) { - callback.onSwiped(viewHolder.adapterPosition) + callback.onSwiped(viewHolder.bindingAdapterPosition) } override fun onSelectedChanged(viewHolder: RecyclerView.ViewHolder?, actionState: Int) { diff --git a/gradle.properties b/gradle.properties index 9a6eff3e6..f66c2cb84 100644 --- a/gradle.properties +++ b/gradle.properties @@ -22,7 +22,6 @@ android.enableJetifier=false # Kotlin code style for this project: "official" or "obsolete": kotlin.code.style=official kotlin.incremental.useClasspathSnapshot=true -kotlin.experimental.tryK2=true android.enableResourceOptimizations=true # android.enableNewResourceShrinker' is deprecated. # It was removed in version 8.0 of the Android Gradle plugin.