create

abstract fun create(parent: ViewGroup): TtInformationControl

Creates an information control within the given parent.

If you want to alternate the styling for individual items in the list, use data binding to inflate a layout. The viewModel variable in the binding will be set to the ListItemContentViewModel that this list item represents.

It's possible to base styling on additional fields by subclassing ListItemContentViewModel. Do make sure that all content items in the list are of this subclass, since binding will otherwise crash with a casting error.

If the styling differs per content list item, it's possible to create a custom layout and use data binding to provide the correct styling for each list item. This layout can be inflated by using the LayoutContentListItemViewFactory.

Note: There is no need to fill TtInformationControl.ttViewModel, this is done automatically by the adapter.

Parameters

parent

The parent ViewGroup which implementations can use when inflating layouts and to access a Context. Passing the parent when inflating a layout ensures the resultant view will inherit the layout's LayoutParams (in particular the layout_width and layout_height values which would otherwise default to WRAP_CONTENT).