public final class

FragmentNavigator.Extras.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.navigation.fragment.FragmentNavigator.Extras.Builder

Overview

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

Summary

Constructors
publicBuilder()

Methods
public FragmentNavigator.Extras.BuilderaddSharedElement(View sharedElement, java.lang.String name)

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

public FragmentNavigator.Extras.BuilderaddSharedElements(java.util.Map<View, java.lang.String> sharedElements)

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

public FragmentNavigator.Extrasbuild()

Constructs the final FragmentNavigator.Extras instance.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder()

Methods

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

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

Parameters:

sharedElements: Shared element pairs to add

Returns:

this FragmentNavigator.Extras.Builder

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

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

Parameters:

sharedElement: A View in the current Fragment to match with a View in the Fragment being navigated to.
name: The transitionName of the View in the Fragment being navigated to that should be matched to the shared element.

Returns:

this FragmentNavigator.Extras.Builder

See also: FragmentTransaction.addSharedElement(View, String)

Constructs the final FragmentNavigator.Extras instance.

Returns:

An immutable FragmentNavigator.Extras instance.