Skip to content

Commit

Permalink
日常提交:2022-11-14.
Browse files Browse the repository at this point in the history
Signed-off-by: 王朋飞 <walgr1010>
  • Loading branch information
王朋飞 committed Nov 14, 2022
1 parent 4513f9c commit 051e554
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ import android.view.ViewGroup
import android.widget.Checkable
import android.widget.TextView
import androidx.core.view.children
import com.wpf.app.quickbind.annotations.BindD2VHelper
import com.wpf.app.quickbind.bindview.QuickRequestData
import com.wpf.app.quickbind.interfaces.RunOnHolderWithSelf

object DataAutoSet2ViewUtils {

var bind2ViewList: MutableList<BindD2VHelper<View, Any>> = arrayListOf()

fun <T : QuickRequestData> autoSet(data: T, view: View) {
setData2ViewGroup(view, data)
}
Expand Down Expand Up @@ -53,5 +56,12 @@ object DataAutoSet2ViewUtils {
view.isChecked = viewData == true
}
}
bind2ViewList.forEach { bind ->
bind.initView(view, data)
}
}
}

interface BindData2View {
fun bind(view: View, data: Any)
}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,5 @@
3.可刷新List支持请求接口后自动加载 已实现

4.布局View支持请求接口后自动映射赋值 已实现

5.布局xml支持接口请求并自动赋值

0 comments on commit 051e554

Please sign in to comment.