diff --git a/app/src/main/java/com/hi/dhl/demo/binding/viewbind/ViewBindCustomView.kt b/app/src/main/java/com/hi/dhl/demo/binding/viewbind/ViewBindCustomView.kt index 48f8e0e..4c86f92 100644 --- a/app/src/main/java/com/hi/dhl/demo/binding/viewbind/ViewBindCustomView.kt +++ b/app/src/main/java/com/hi/dhl/demo/binding/viewbind/ViewBindCustomView.kt @@ -4,6 +4,7 @@ import android.content.Context import android.util.AttributeSet import android.widget.LinearLayout import com.hi.dhl.binding.viewbind +import com.hi.dhl.demo.binding.databinding.LayoutMergeItemBinding import com.hi.dhl.demo.binding.databinding.LayoutViewCustomBinding /** @@ -32,6 +33,9 @@ class ViewBindCustomView @JvmOverloads constructor( onDialogClickListener.onClick() } } + + LayoutMergeItemBinding.bind(root) + .mergeTvTitle.setText("在 ViewGroup 中使用 merge 标签") } } diff --git a/app/src/main/res/layout/layout_view_custom.xml b/app/src/main/res/layout/layout_view_custom.xml index abd9687..af9ae12 100644 --- a/app/src/main/res/layout/layout_view_custom.xml +++ b/app/src/main/res/layout/layout_view_custom.xml @@ -10,4 +10,6 @@ android:layout_width="wrap_content" android:layout_height="30dp" /> + +