SharedElementCallback

public abstract class SharedElementCallback


Listener provided in setEnterSharedElementCallback and setExitSharedElementCallback to monitor the Activity transitions. The events can be used to customize Activity Transition behavior.

Summary

Nested types

SharedElementCallback.OnSharedElementsReadyListener

Listener to be called after onSharedElementsArrived when the shared elements are ready to be hidden in the source Activity and shown in the destination Activity.

Public constructors

Public methods

Parcelable
onCaptureSharedElementSnapshot(
    View sharedElement,
    Matrix viewToGlobalMatrix,
    RectF screenBounds
)

Creates a snapshot of a shared element to be used by the remote Activity and reconstituted with onCreateSnapshotView.

View

Reconstitutes a snapshot View from a Parcelable returned in onCaptureSharedElementSnapshot to be used in onSharedElementStart and onSharedElementEnd.

void
onMapSharedElements(
    List<String> names,
    Map<StringView> sharedElements
)

Lets the SharedElementCallback adjust the mapping of shared element names to Views.

void
onRejectSharedElements(List<View> rejectedSharedElements)

Called after onMapSharedElements when transferring shared elements in.

void
onSharedElementEnd(
    List<String> sharedElementNames,
    List<View> sharedElements,
    List<View> sharedElementSnapshots
)

In Activity Transitions, onSharedElementEnd is called immediately before capturing the end of the shared element state on enter and reenter transitions and immediately before capturing the start of the shared element state for exit and return transitions.

void
onSharedElementStart(
    List<String> sharedElementNames,
    List<