diff --git a/QuickBind/src/main/java/com/wpf/app/quickbind/utils/DataAutoSet2ViewUtils.kt b/QuickBind/src/main/java/com/wpf/app/quickbind/utils/DataAutoSet2ViewUtils.kt index 1a6b3346..89633632 100644 --- a/QuickBind/src/main/java/com/wpf/app/quickbind/utils/DataAutoSet2ViewUtils.kt +++ b/QuickBind/src/main/java/com/wpf/app/quickbind/utils/DataAutoSet2ViewUtils.kt @@ -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> = arrayListOf() + fun autoSet(data: T, view: View) { setData2ViewGroup(view, data) } @@ -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) } \ No newline at end of file diff --git a/README.md b/README.md index 71e3f3db..5c3886bc 100755 --- a/README.md +++ b/README.md @@ -53,3 +53,5 @@ 3.可刷新List支持请求接口后自动加载 已实现 4.布局View支持请求接口后自动映射赋值 已实现 + + 5.布局xml支持接口请求并自动赋值