Skip to content

Commit

Permalink
日常提交:2022-09-07.
Browse files Browse the repository at this point in the history
  • Loading branch information
walgr committed Sep 7, 2022
1 parent 39cba89 commit 8fded4a
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ class QuickAdapter : RecyclerView.Adapter<QuickViewHolder<QuickItemData>>(), 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<QuickItemData>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ open class QuickBindData(
) {
mAdapter = adapter
mViewHolder = viewHolder
mView = viewHolder.itemView
if (dealBind) {
dealInPlugins(this, null, QuickBind.bindPlugin)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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<QuickBindData>,
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)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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<QuickBindData>,
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)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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<QuickBindData>,
position: Int
) {
super.onBindViewHolder(adapter, viewHolder, position)
BindData2ViewHelper.bind(viewHolder.itemView.findViewById(R.id.rootView),
space, if (isVertical) Height2View else Width2View)
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit 8fded4a

Please sign in to comment.