FragmentNavigator.Extras.Builder

class FragmentNavigator.Extras.Builder


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

Summary

Public constructors

Public functions

FragmentNavigator.Extras.Builder
addSharedElement(sharedElement: View, 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(sharedElements: Map<ViewString>)

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

Builder

Added in 1.0.0
Builder()

Public functions

addSharedElement

Added in 1.0.0
fun addSharedElement(sharedElement: View, 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: String

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
fun addSharedElements(sharedElements: Map<ViewString>): FragmentNavigator.Extras.Builder

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

Parameters
sharedElements: Map<ViewString>

Shared element pairs to add

build

Added in 1.0.0
fun build(): FragmentNavigator.Extras

Constructs the final Extras instance.

Returns
FragmentNavigator.Extras

An immutable Extras instance.