//Extensions for Dagger Hilt/it.czerwinski.android.hilt.fragment.testing/launchFragmentInContainer

launchFragmentInContainer

[androidJvm]
Content
inline fun <F : Fragment> launchFragmentInContainer(fragmentArgs: Bundle? = null, @StyleRes()themeResId: Int = HiltFragmentScenario.defaultTheme, factory: FragmentFactory? = null): HiltFragmentScenario<F, HiltFragmentScenario.EmptyFragmentActivity>
More info

Launches a Fragment in the Activity’s root view container android.R.id.content, with given arguments hosted by an empty FragmentActivity and waits for it to reach a resumed state.

This method cannot be called from the main thread.

Parameters

androidJvm

Name Summary
fragmentArgs

a bundle to passed into fragment

themeResId

a style resource id to be set to the host activity’s theme

factory

a fragment factory to use or null to use default factory

[androidJvm]
Content
inline fun <F : Fragment> launchFragmentInContainer(fragmentArgs: Bundle? = null, @StyleRes()themeResId: Int = HiltFragmentScenario.defaultTheme, crossinline instantiate: () -> F): HiltFragmentScenario<F, HiltFragmentScenario.EmptyFragmentActivity>
More info

Launches a Fragment in the Activity’s root view container android.R.id.content, with given arguments hosted by an empty FragmentActivity using instantiate to create the Fragment and waits for it to reach a resumed state.

This method cannot be called from the main thread.

Parameters

androidJvm

Name Summary
fragmentArgs

a bundle to passed into fragment

themeResId

a style resource id to be set to the host activity’s theme

instantiate

method which will be used to instantiate the Fragment. This is a simplification of the FragmentFactory interface for cases where only a single class needs a custom constructor called.