Package icyllis.modernui.fragment

# Interface FragmentLifecycleCallbacks

public interface FragmentLifecycleCallbacks
Callback interface for listening to fragment state changes that happen within a given FragmentManager.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `default void`
  `onFragmentAttached(FragmentManager fm, Fragment f)`
  Called after the fragment has been attached to its host.
  `default void`
  `onFragmentCreated(FragmentManager fm, Fragment f, DataSet savedInstanceState)`
  Called after the fragment has returned from the FragmentManager's call to `Fragment.onCreate(DataSet)`.
  `default void`
  `onFragmentDestroyed(FragmentManager fm, Fragment f)`
  Called after the fragment has returned from the FragmentManager's call to `Fragment.onDestroy()`.
  `default void`
  `onFragmentDetached(FragmentManager fm, Fragment f)`
  Called after the fragment has returned from the FragmentManager's call to `Fragment.onDetach()`.
  `default void`
  `onFragmentPaused(FragmentManager fm, Fragment f)`
  Called after the fragment has returned from the FragmentManager's call to `Fragment.onPause()`.
  `default void`
  `onFragmentPreAttached(FragmentManager fm, Fragment f)`
  Called right before the fragment's `Fragment.onAttach(icyllis.modernui.core.Context)` method is called.
  `default void`
  `onFragmentPreCreated(FragmentManager fm, Fragment f, DataSet savedInstanceState)`
  Called right before the fragment's `Fragment.onCreate(DataSet)` method is called.
  `default void`
  `onFragmentResumed(FragmentManager fm, Fragment f)`
  Called after the fragment has returned from the FragmentManager's call to `Fragment.onResume()`.
  `default void`
  `onFragmentSaveInstanceState(FragmentManager fm, Fragment f, DataSet outState)`
  Called after the fragment has returned from the FragmentManager's call to `Fragment.onSaveInstanceState(DataSet)`.
  `default void`
  `onFragmentStarted(FragmentManager fm, Fragment f)`
  Called after the fragment has returned from the FragmentManager's call to `Fragment.onStart()`.
  `default void`
  `onFragmentStopped(FragmentManager fm, Fragment f)`
  Called after the fragment has returned from the FragmentManager's call to `Fragment.onStop()`.
  `default void`
  `onFragmentViewCreated(FragmentManager fm, Fragment f, View v, DataSet savedInstanceState)`
  Called after the fragment has returned a non-null view from the FragmentManager's request to `Fragment.onCreateView(icyllis.modernui.view.LayoutInflater, ViewGroup, DataSet)`.
  `default void`
  `onFragmentViewDestroyed(FragmentManager fm, Fragment f)`
  Called after the fragment has returned from the FragmentManager's call to `Fragment.onDestroyView()`.

- ## Method Details

  - ### onFragmentPreAttached

    default void onFragmentPreAttached(@Nonnull FragmentManager fm, @Nonnull Fragment f)
    Called right before the fragment's `Fragment.onAttach(icyllis.modernui.core.Context)` method is called. This is a good time to inject any required dependencies or perform other configuration for the fragment before any of the fragment's lifecycle methods are invoked.
    Parameters:
      `fm` - Host FragmentManager
      `f` - Fragment changing state

  - ### onFragmentAttached

    default void onFragmentAttached(@Nonnull FragmentManager fm, @Nonnull Fragment f)
    Called after the fragment has been attached to its host. Its host will have had `onAttachFragment` called before this call happens.
    Parameters:
      `fm` - Host FragmentManager
      `f` - Fragment changing state

  - ### onFragmentPreCreated

    default void onFragmentPreCreated(@Nonnull FragmentManager fm, @Nonnull Fragment f, @Nullable DataSet savedInstanceState)
    Called right before the fragment's `Fragment.onCreate(DataSet)` method is called. This is a good time to inject any required dependencies or perform other configuration for the fragment.
    Parameters:
      `fm` - Host FragmentManager
      `f` - Fragment changing state
      `savedInstanceState` - Saved instance bundle from a previous instance

  - ### onFragmentCreated

    default void onFragmentCreated(@Nonnull FragmentManager fm, @Nonnull Fragment f, @Nullable DataSet savedInstanceState)
    Called after the fragment has returned from the FragmentManager's call to `Fragment.onCreate(DataSet)`. This will only happen once for any given fragment instance, though the fragment may be attached and detached multiple times.
    Parameters:
      `fm` - Host FragmentManager
      `f` - Fragment changing state
      `savedInstanceState` - Saved instance bundle from a previous instance

  - ### onFragmentViewCreated

    default void onFragmentViewCreated(@Nonnull FragmentManager fm, @Nonnull Fragment f, @Nonnull View v, @Nullable DataSet savedInstanceState)
    Called after the fragment has returned a non-null view from the FragmentManager's request to `Fragment.onCreateView(icyllis.modernui.view.LayoutInflater, ViewGroup, DataSet)`.
    Parameters:
      `fm` - Host FragmentManager
      `f` - Fragment that created and owns the view
      `v` - View returned by the fragment
      `savedInstanceState` - Saved instance bundle from a previous instance

  - ### onFragmentStarted

    default void onFragmentStarted(@Nonnull FragmentManager fm, @Nonnull Fragment f)
    Called after the fragment has returned from the FragmentManager's call to `Fragment.onStart()`.
    Parameters:
      `fm` - Host FragmentManager
      `f` - Fragment changing state

  - ### onFragmentResumed

    default void onFragmentResumed(@Nonnull FragmentManager fm, @Nonnull Fragment f)
    Called after the fragment has returned from the FragmentManager's call to `Fragment.onResume()`.
    Parameters:
      `fm` - Host FragmentManager
      `f` - Fragment changing state

  - ### onFragmentPaused

    default void onFragmentPaused(@Nonnull FragmentManager fm, @Nonnull Fragment f)
    Called after the fragment has returned from the FragmentManager's call to `Fragment.onPause()`.
    Parameters:
      `fm` - Host FragmentManager
      `f` - Fragment changing state

  - ### onFragmentStopped

    default void onFragmentStopped(@Nonnull FragmentManager fm, @Nonnull Fragment f)
    Called after the fragment has returned from the FragmentManager's call to `Fragment.onStop()`.
    Parameters:
      `fm` - Host FragmentManager
      `f` - Fragment changing state

  - ### onFragmentSaveInstanceState

    default void onFragmentSaveInstanceState(@Nonnull FragmentManager fm, @Nonnull Fragment f, @Nonnull DataSet outState)
    Called after the fragment has returned from the FragmentManager's call to `Fragment.onSaveInstanceState(DataSet)`.
    Parameters:
      `fm` - Host FragmentManager
      `f` - Fragment changing state
      `outState` - Saved state bundle for the fragment

  - ### onFragmentViewDestroyed

    default void onFragmentViewDestroyed(@Nonnull FragmentManager fm, @Nonnull Fragment f)
    Called after the fragment has returned from the FragmentManager's call to `Fragment.onDestroyView()`.
    Parameters:
      `fm` - Host FragmentManager
      `f` - Fragment changing state

  - ### onFragmentDestroyed

    default void onFragmentDestroyed(@Nonnull FragmentManager fm, @Nonnull Fragment f)
    Called after the fragment has returned from the FragmentManager's call to `Fragment.onDestroy()`.
    Parameters:
      `fm` - Host FragmentManager
      `f` - Fragment changing state

  - ### onFragmentDetached

    default void onFragmentDetached(@Nonnull FragmentManager fm, @Nonnull Fragment f)
    Called after the fragment has returned from the FragmentManager's call to `Fragment.onDetach()`.
    Parameters:
      `fm` - Host FragmentManager
      `f` - Fragment changing state