//Extensions for Dagger Hilt/it.czerwinski.android.hilt.fragment.testing/launchFragment
launchFragment
[androidJvm]
Content
inline fun <F : Fragment> launchFragment(fragmentArgs: Bundle? = null, @StyleRes()themeResId: Int = HiltFragmentScenario.defaultTheme, factory: FragmentFactory? = null): HiltFragmentScenario<F, HiltFragmentScenario.EmptyFragmentActivity>
More info
Launches a Fragment with given arguments hosted by an empty FragmentActivity using given FragmentFactory 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> launchFragment(fragmentArgs: Bundle? = null, @StyleRes()themeResId: Int = HiltFragmentScenario.defaultTheme, crossinline instantiate: () -> F): HiltFragmentScenario<F, HiltFragmentScenario.EmptyFragmentActivity>
More info
Launches a Fragment 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. |