public abstract class AbstractListDetailFragment extends Fragment implements LifecycleOwner, ViewModelStoreOwner, HasDefaultViewModelProviderFactory, LifecycleOwner, SavedStateRegistryOwner, ActivityResultCaller

   ↳ Fragment
     ↳ AbstractListDetailFragment

A fragment supports adaptive two-pane layout. The first child is a list pane, which could be a content list or browser, and the second child is NavHostFragment which controls to navigate between different detail views.

Implementation of the fragment should override this class and implement AbstractListDetailFragment.onCreateListPaneView to supply custom view for the list pane. The fragment provides default NavHostFragment with a NavGraph ID passed in the fragment, and it can be overridden by AbstractListDetailFragment.onCreateDetailPaneNavHostFragment and provide custom NavHostFragment.


Public fields

final @NonNull NavHostFragment

Return the NavHostFragment this fragment uses

final @NonNull SlidingPaneLayout

Return the SlidingPaneLayout this fragment is currently controlling.

Public constructors

Public methods

@NonNull NavHostFragment

Return an alternative NavHostFragment to swap the default NavHostFragment in the fragment.

abstract @NonNull View
    LayoutInflater inflater,
    ViewGroup container,
    Bundle savedInstanceState

Provide a list pane view for the fragment.

final @CallSuper @NonNull View
    LayoutInflater inflater,
    ViewGroup container,
    Bundle savedInstanceState

Create the view for the fragment.

@CallSuper void
    Context context,
    AttributeSet attrs,
    Bundle savedInstanceState

Called when a fragment is being created as part of a view layout inflation, typically from setting the content view of an activity.

onListPaneViewCreated(View view, Bundle savedInstanceState)

Provides list pane view created in the fragment.

@CallSuper void

Called to ask the fragment to save its current dynamic state, so it can later be reconstructed in a new instance if its process is restarted.

final @CallSuper void
onViewCreated(View view, Bundle savedInstanceState)

This method provides a callback onListPaneViewCreated after the view hierarchy has been completely created.

@CallSuper void
onViewStateRestored(Bundle savedInstanceState)

Called when all saved state has been restored into the view hierarchy of the fragment.