Skip to content

Commit

Permalink
feat: add merge to the ViewGroup
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-dhl committed May 8, 2021
1 parent 49f1375 commit 7adf844
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

/**
Expand Down Expand Up @@ -32,6 +33,9 @@ class ViewBindCustomView @JvmOverloads constructor(
onDialogClickListener.onClick()
}
}

LayoutMergeItemBinding.bind(root)
.mergeTvTitle.setText("在 ViewGroup 中使用 merge 标签")
}
}

Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/layout/layout_view_custom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@
android:layout_width="wrap_content"
android:layout_height="30dp" />

<include layout="@layout/layout_merge_item" />

</LinearLayout>

0 comments on commit 7adf844

Please sign in to comment.