diff --git a/Quick/src/main/java/com/wpf/app/quick/widgets/recyclerview/QuickAdapter.kt b/Quick/src/main/java/com/wpf/app/quick/widgets/recyclerview/QuickAdapter.kt index dac3204f..31398b38 100644 --- a/Quick/src/main/java/com/wpf/app/quick/widgets/recyclerview/QuickAdapter.kt +++ b/Quick/src/main/java/com/wpf/app/quick/widgets/recyclerview/QuickAdapter.kt @@ -54,9 +54,9 @@ class QuickAdapter : RecyclerView.Adapter>(), Dat } holder?.let { holder.onCreateViewHolder(holder.itemView) - if (findData is QuickBindData) { - findData.onCreateViewHolder(holder.itemView) - } +// if (findData is QuickBindData) { +// findData.onCreateViewHolder(holder.itemView) +// } } return holder as QuickViewHolder } diff --git a/Quick/src/main/java/com/wpf/app/quick/widgets/recyclerview/QuickBindData.kt b/Quick/src/main/java/com/wpf/app/quick/widgets/recyclerview/QuickBindData.kt index b0d184d6..21405e33 100644 --- a/Quick/src/main/java/com/wpf/app/quick/widgets/recyclerview/QuickBindData.kt +++ b/Quick/src/main/java/com/wpf/app/quick/widgets/recyclerview/QuickBindData.kt @@ -43,6 +43,7 @@ open class QuickBindData( ) { mAdapter = adapter mViewHolder = viewHolder + mView = viewHolder.itemView if (dealBind) { dealInPlugins(this, null, QuickBind.bindPlugin) } diff --git a/Quick/src/main/java/com/wpf/app/quick/widgets/recyclerview/utils/ClickItem.kt b/Quick/src/main/java/com/wpf/app/quick/widgets/recyclerview/utils/ClickItem.kt index 1a7014a8..402279f1 100644 --- a/Quick/src/main/java/com/wpf/app/quick/widgets/recyclerview/utils/ClickItem.kt +++ b/Quick/src/main/java/com/wpf/app/quick/widgets/recyclerview/utils/ClickItem.kt @@ -3,7 +3,9 @@ package com.wpf.app.quick.widgets.recyclerview.utils import android.view.View import com.wpf.app.quick.helper.binddatahelper.BindData2ViewHelper import com.wpf.app.quick.helper.binddatahelper.ItemClick +import com.wpf.app.quick.widgets.recyclerview.QuickAdapter import com.wpf.app.quick.widgets.recyclerview.QuickBindData +import com.wpf.app.quick.widgets.recyclerview.QuickViewHolder import com.wpf.app.quickbind.interfaces.RunItemClick import com.wpf.app.quickbind.interfaces.RunItemClickWithSelf @@ -17,10 +19,14 @@ open class ClickItem @JvmOverloads constructor( private val click: RunItemClick? = null, ) : QuickBindData(layoutId) { - override fun onCreateViewHolder(itemView: View) { - super.onCreateViewHolder(itemView) + override fun onBindViewHolder( + adapter: QuickAdapter, + viewHolder: QuickViewHolder, + position: Int + ) { + super.onBindViewHolder(adapter, viewHolder, position) if (clickSelf != null || click != null) { - BindData2ViewHelper.bind(itemView, clickSelf?.run(this) ?: click?.run()!!, ItemClick) + BindData2ViewHelper.bind(viewHolder.itemView, clickSelf?.run(this) ?: click?.run()!!, ItemClick) } } } \ No newline at end of file diff --git a/Quick/src/main/java/com/wpf/app/quick/widgets/recyclerview/utils/LineItem.kt b/Quick/src/main/java/com/wpf/app/quick/widgets/recyclerview/utils/LineItem.kt index d53e6b1a..f841bf80 100644 --- a/Quick/src/main/java/com/wpf/app/quick/widgets/recyclerview/utils/LineItem.kt +++ b/Quick/src/main/java/com/wpf/app/quick/widgets/recyclerview/utils/LineItem.kt @@ -7,6 +7,9 @@ import com.wpf.app.quick.R import com.wpf.app.quick.helper.binddatahelper.BindData2ViewHelper import com.wpf.app.quick.helper.binddatahelper.Color2View import com.wpf.app.quick.helper.binddatahelper.Height2View +import com.wpf.app.quick.widgets.recyclerview.QuickAdapter +import com.wpf.app.quick.widgets.recyclerview.QuickBindData +import com.wpf.app.quick.widgets.recyclerview.QuickViewHolder /** * Created by 王朋飞 on 2022/7/21. @@ -20,9 +23,13 @@ open class LineItem( override val isVertical: Boolean = true ) : SpaceItem(space = width, isVertical) { - override fun onCreateViewHolder(itemView: View) { - super.onCreateViewHolder(itemView) - BindData2ViewHelper.bind(itemView.findViewById(R.id.rootView), color, Color2View) - BindData2ViewHelper.bind(itemView.findViewById(R.id.rootView), height, Height2View) + override fun onBindViewHolder( + adapter: QuickAdapter, + viewHolder: QuickViewHolder, + position: Int + ) { + super.onBindViewHolder(adapter, viewHolder, position) + BindData2ViewHelper.bind(viewHolder.itemView.findViewById(R.id.rootView), color, Color2View) + BindData2ViewHelper.bind(viewHolder.itemView.findViewById(R.id.rootView), height, Height2View) } } \ No newline at end of file diff --git a/Quick/src/main/java/com/wpf/app/quick/widgets/recyclerview/utils/SpaceItem.kt b/Quick/src/main/java/com/wpf/app/quick/widgets/recyclerview/utils/SpaceItem.kt index 7b1c66ea..2fc2503a 100644 --- a/Quick/src/main/java/com/wpf/app/quick/widgets/recyclerview/utils/SpaceItem.kt +++ b/Quick/src/main/java/com/wpf/app/quick/widgets/recyclerview/utils/SpaceItem.kt @@ -5,7 +5,9 @@ import com.wpf.app.quick.R import com.wpf.app.quick.helper.binddatahelper.BindData2ViewHelper import com.wpf.app.quick.helper.binddatahelper.Height2View import com.wpf.app.quick.helper.binddatahelper.Width2View +import com.wpf.app.quick.widgets.recyclerview.QuickAdapter import com.wpf.app.quick.widgets.recyclerview.QuickBindData +import com.wpf.app.quick.widgets.recyclerview.QuickViewHolder /** * Created by 王朋飞 on 2022/7/20. @@ -16,9 +18,13 @@ open class SpaceItem( open val isVertical: Boolean = true ): QuickBindData(R.layout.adapter_space) { - override fun onCreateViewHolder(itemView: View) { - super.onCreateViewHolder(itemView) - BindData2ViewHelper.bind(itemView.findViewById(R.id.rootView), - space, if (isVertical) Height2View else Width2View) + override fun onBindViewHolder( + adapter: QuickAdapter, + viewHolder: QuickViewHolder, + position: Int + ) { + super.onBindViewHolder(adapter, viewHolder, position) + BindData2ViewHelper.bind(viewHolder.itemView.findViewById(R.id.rootView), + space, if (isVertical) Height2View else Width2View) } } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 263f35e1..fe8a48fa 100755 --- a/gradle.properties +++ b/gradle.properties @@ -28,7 +28,7 @@ android.nonTransitiveRClass=true IS_REMOTE=true IS_ONLY_PLUGIN=false GROUP=com.wpf.app.quick -VERSION_NAME=0.2.16 +VERSION_NAME=0.2.18 POM_DESCRIPTION=Quick Android.