ViewProvider

class ViewProvider<T>(lifecycleOwner: LifecycleOwner, itemViewFactoryProvider: (T) -> ViewFactory<T>, overflowIndicatorViewFactoryProvider: (Any?) -> ViewFactory<Any?>?)

Provides views for items in a TtPriorityLayout and optionally for the overflow indicator.

itemViewFactoryProvider is used to provide a ViewFactory for a TtPriorityLayout item. If overflowIndicatorViewFactoryProvider is not null, it is used to provide a ViewFactory for the overflow indicator.

itemViewFactoryProvider is provided with the TtPriorityLayout item. overflowIndicatorViewFactoryProvider is provided with the value of TtPriorityLayout.ttOverflowIndicatorContent.

See the secondary constructors to use a LayoutProvider instead of a ViewFactory or to inflate the same layout for each item.

Constructors

Link copied to clipboard
constructor(lifecycleOwner: LifecycleOwner, layoutProvider: LayoutProvider<T>)

Use InflateViewFactory to inflate a layout based on a layout ID provided by layoutProvider for each TtPriorityLayout item and optionally for the overflow indicator.

constructor(lifecycleOwner: LifecycleOwner, layoutId: Int)

Convenience constructor to create a view provider that provides the same layout ID for all items.

constructor(lifecycleOwner: LifecycleOwner, itemViewFactoryProvider: (T) -> ViewFactory<T>, overflowIndicatorViewFactoryProvider: (Any?) -> ViewFactory<Any?>?)