Builder

class Builder
kotlin.Any
   ↳ androidx.navigation.fragment.FragmentNavigator.Extras.Builder

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

Summary

Public constructors

Builder for constructing new Extras instances.

Public methods

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

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

FragmentNavigator.Extras.Builder
addSharedElements(@NonNull sharedElements: MutableMap<View!, String!>)

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

FragmentNavigator.Extras

Constructs the final Extras instance.

Public constructors

<init>

Builder()

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

Public methods

addSharedElement

@NonNull fun addSharedElement(@NonNull sharedElement: View, @NonNull name: String): FragmentNavigator.Extras.Builder

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 View: The transitionName of the View in the Fragment being navigated to that should be matched to the shared element.
Return
FragmentNavigator.Extras.Builder: this Builder

addSharedElements

@NonNull fun addSharedElements(@NonNull sharedElements: MutableMap<View!, String!>): FragmentNavigator.Extras.Builder

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

Parameters
sharedElements MutableMap<View!, String!>: Shared element pairs to add
Return
FragmentNavigator.Extras.Builder: this Builder

build

@NonNull fun build(): FragmentNavigator.Extras

Constructs the final Extras instance.

Return
FragmentNavigator.Extras: An immutable Extras instance.