AdaptiveFragmentHelper

fun <T : Enum<T>> AdaptiveFragmentHelper(    fragment: Fragment,     viewVariantSelector: (widthDp: Int, heightDp: Int) -> T,     viewFactoryProvider: (T) -> IviFragment.ViewFactory<*>)

Parameters

T

The enum type of view variant.

fragment

The adaptive fragment.

viewVariantSelector

Called when the fragment's root view updates its size in order to determine which view variant to use. If the returned value differs from the previous one the fragment will be reattached in order to recreate the view. In case the value to which the size is compared is stored in the dimen xml, one can use the Context.getDimensionByAttrInDp function.

viewFactoryProvider

Called when the size of the fragment's root view changes and a different view variant is returned by viewVariantSelector. This function should return the new value for viewFactory, which can be returned from IviFragment.viewFactory to apply the new view variant when the fragment recreates its view.