-
public final class KatanaFragmentDelegate<T extends Fragment>Usually Katana components of Fragments depend on components of the parent Activity.
Since Fragments are instantiated before Activities, the component initialization must be delayed until the Activity was created.
The delegate simplifies this procedure a bit. A delegate is for example created in the init block of the Fragment via fragmentDelegate. onActivityCreated of the delegate must be called in Fragment.onActivityCreated. The lambda passed to the delegate is called when onActivityCreated was called. Inside the lambda component initialization and dependency injection should be performed.
-
-
Method Summary
Modifier and Type Method Description final UnitonActivityCreated(Bundle savedInstanceState)Must be called in Fragment.onActivityCreated of Fragment associated with this delegate. -
-
Method Detail
-
onActivityCreated
final Unit onActivityCreated(Bundle savedInstanceState)
Must be called in Fragment.onActivityCreated of Fragment associated with this delegate.
- Parameters:
savedInstanceState- Saved state as passed to Fragment.onActivityCreated.
-
-
-
-