Interface Fragments

All Known Implementing Classes:
FragmentsImpl

public interface Fragments
Factory for creating Fragments.
  • Method Details

    • create

      <F extends Fragment<?>> F create(FragmentOwner parent, Class<F> fragmentClass)
      Creates a fragment instance by its controller class.

      For example:

      
          AddressFragment addressFragment = fragments.create(this, AddressFragment.class);
          getContent().add(addressFragment);
       
      Type Parameters:
      F - fragment type
      Parameters:
      parent - parent UI controller
      fragmentClass - fragment controller class
      Returns:
      fully initialized fragment instance
    • init

      void init(ComponentLoader.Context hostContext, Fragment<?> fragment)
      Initializes passed fragment by processing FragmentDescriptor.
      Parameters:
      hostContext - parent controller loader context. Used to get additional data that is needed for correct initialization. For example, provided data components
      fragment - fragment to initialize