binding

fun <T : ViewDataBinding> ViewGroup.binding(@LayoutRes() layoutRes: Int, attachToParent: Boolean = false): T

Author

skydoves (Jaewoong Eum)

A binding extension for inflating a layoutRes and returns a DataBinding type T.

Return

T A DataBinding class that inflated using the layoutRes.

Parameters

layoutRes

The layout resource ID of the layout to inflate.

attachToParent

Whether the inflated hierarchy should be attached to the parent parameter.

fun <T : ViewDataBinding> ViewGroup.binding(@LayoutRes() layoutRes: Int, attachToParent: Boolean = false, block: T.() -> Unit): T

Author

skydoves (Jaewoong Eum)

A binding extension for inflating a layoutRes and returns a DataBinding type T with a receiver.

Return

T A DataBinding class that inflated using the layoutRes.

Parameters

layoutRes

The layout resource ID of the layout to inflate.

attachToParent

Whether the inflated hierarchy should be attached to the parent parameter.

block

A DataBinding receiver lambda.