inflate

Inflates a binding layout and returns the newly-created binding for that layout.

Use this version only if layoutId is unknown in advance. Otherwise, use
the generated Binding's inflate method to ensure type-safe inflation.

Parameters

inflater

LayoutInflater: The LayoutInflater used to inflate the binding layout.

layoutId

int: The layout resource ID of the layout to inflate.

parent

ViewGroup: Optional view to be the parent of the generated hierarchy
(if attachToParent is true), or else simply an object that provides
a set of LayoutParams values for root of the returned hierarchy
(if attachToParent is false.)

attachToParent

boolean: Whether the inflated hierarchy should be attached to the
parent parameter. If false, parent is only used to create
the correct subclass of LayoutParams for the root view in the XML.

bindingComponent

DataBindingComponent: The DataBindingComponent to use in the binding.

Returns

T

The newly-created binding for the inflated layout or null if
the layoutId wasn't for a binding layout.

Use this version only if layoutId is unknown in advance. Otherwise, use
the generated Binding's inflate method to ensure type-safe inflation.

Parameters

inflater

LayoutInflater: The LayoutInflater used to inflate the binding layout.

layoutId

int: The layout resource ID of the layout to inflate.

parent

ViewGroup: Optional view to be the parent of the generated hierarchy
(if attachToParent is true), or else simply an object that provides
a set of LayoutParams values for root of the returned hierarchy
(if attachToParent is false.)

attachToParent

boolean: Whether the inflated hierarchy should be attached to the
parent parameter. If false, parent is only used to create
the correct subclass of LayoutParams for the root view in the XML.

Returns

T

The newly-created binding for the inflated layout or null if
the layoutId wasn't for a binding layout.