FragmentNavigator.Extras.Builder

public static final class FragmentNavigator.Extras.Builder
extends Object

java.lang.Object
   ↳ androidx.navigation.fragment.FragmentNavigator.Extras.Builder


Builder for constructing new FragmentNavigator.Extras instances. The resulting instances are immutable.

Summary

Public constructors

FragmentNavigator.Extras.Builder()

Public methods

FragmentNavigator.Extras.Builder addSharedElement(View sharedElement, String name)

Maps the given View in the current Fragment to the given transition name in the Fragment being navigated to.

FragmentNavigator.Extras.Builder addSharedElements(Map<View, String> sharedElements)

Adds multiple shared elements for mapping Views in the current Fragment to transitionNames in the Fragment being navigated to.

FragmentNavigator.Extras build()

Constructs the final FragmentNavigator.Extras instance.

Inherited methods

Public constructors

FragmentNavigator.Extras.Builder

public FragmentNavigator.Extras.Builder ()

Public methods

addSharedElement

public FragmentNavigator.Extras.Builder addSharedElement (View sharedElement, 
                String name)

Maps the given View in the current Fragment to the given transition name in the Fragment being navigated to.

Parameters
sharedElement View: A View in the current Fragment to match with a View in the Fragment being navigated to.

name String: The transitionName of the View in the Fragment being navigated to that should be matched to the shared element.

Returns
FragmentNavigator.Extras.Builder this FragmentNavigator.Extras.Builder

addSharedElements

public FragmentNavigator.Extras.Builder addSharedElements (Map<View, String> sharedElements)

Adds multiple shared elements for mapping Views in the current Fragment to transitionNames in the Fragment being navigated to.

Parameters
sharedElements Map: Shared element pairs to add

Returns
FragmentNavigator.Extras.Builder this FragmentNavigator.Extras.Builder

build

public FragmentNavigator.Extras build ()

Constructs the final FragmentNavigator.Extras instance.

Returns
FragmentNavigator.Extras An immutable FragmentNavigator.Extras instance.