FragmentNavigator.Extras.Builder


public final class FragmentNavigator.Extras.Builder


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

Summary

Public constructors

Public methods

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

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

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

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

final @NonNull FragmentNavigator.Extras

Constructs the final Extras instance.

Public constructors

Builder

Added in 1.0.0
public Builder()

Public methods

addSharedElement

Added in 1.0.0
public final @NonNull FragmentNavigator.Extras.Builder addSharedElement(@NonNull View sharedElement, @NonNull String name)

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

Parameters
@NonNull View sharedElement

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

@NonNull String name

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

See also
addSharedElement

addSharedElements

Added in 1.0.0
public final @NonNull FragmentNavigator.Extras.Builder addSharedElements(
    @NonNull Map<@NonNull View, @NonNull String> sharedElements
)

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

Parameters
@NonNull Map<@NonNull View, @NonNull String> sharedElements

Shared element pairs to add

build

Added in 1.0.0
public final @NonNull FragmentNavigator.Extras build()

Constructs the final Extras instance.

Returns
@NonNull FragmentNavigator.Extras

An immutable Extras instance.