Google se compromete a impulsar la igualdad racial para las comunidades afrodescendientes. Obtén información al respecto.

SharedElementCallback

abstract class SharedElementCallback
kotlin.Any
   ↳ androidx.core.app.SharedElementCallback

Listener provided in androidx.fragment.app.FragmentActivity#setEnterSharedElementCallback(SharedElementCallback) and androidx.fragment.app.FragmentActivity#setExitSharedElementCallback(SharedElementCallback) to monitor the Activity transitions. The events can be used to customize Activity Transition behavior.

Summary

Nested classes
abstract

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

Public constructors

Listener provided in androidx.fragment.app.FragmentActivity#setEnterSharedElementCallback(SharedElementCallback) and androidx.fragment.app.FragmentActivity#setExitSharedElementCallback(SharedElementCallback) to monitor the Activity transitions.

Public methods
open Parcelable!
onCaptureSharedElementSnapshot(sharedElement: View!, viewToGlobalMatrix: Matrix!, screenBounds: RectF!)

Creates a snapshot of a shared element to be used by the remote Activity and reconstituted with onCreateSnapshotView(android.content.Context, android.os.Parcelable).

open View!
onCreateSnapshotView(context: Context!, snapshot: Parcelable!)

Reconstitutes a snapshot View from a Parcelable returned in onCaptureSharedElementSnapshot(android.view.View, android.graphics.Matrix, * android.graphics.RectF) to be used in onSharedElementStart(java.util.List, * java.util.List, java.util.List) and onSharedElementEnd(java.util.List, * java.util.List, java.util.List).

open Unit
onMapSharedElements(names: MutableList<String!>!, sharedElements: MutableMap<String!, View!>!)

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

open Unit
onRejectSharedElements(rejectedSharedElements: MutableList<View!>!)

Called after onMapSharedElements(java.util.List, java.util.Map) when transferring shared elements in.

open Unit
onSharedElementEnd(sharedElementNames: MutableList<String!>!, sharedElements: MutableList<View!>!, sharedElementSnapshots: MutableList<View!>!)

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.

open Unit
onSharedElementStart(sharedElementNames: MutableList<String!>!, sharedElements: MutableList<View!>!, sharedElementSnapshots: MutableList<View!>!)

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

open Unit

Called during an Activity Transition when the shared elements have arrived at the final location and are ready to be transferred.

Public constructors

<init>

SharedElementCallback()

Listener provided in androidx.fragment.app.FragmentActivity#setEnterSharedElementCallback(SharedElementCallback) and androidx.fragment.app.FragmentActivity#setExitSharedElementCallback(SharedElementCallback) to monitor the Activity transitions. The events can be used to customize Activity Transition behavior.

Public methods

onCaptureSharedElementSnapshot

open fun onCaptureSharedElementSnapshot(
    sharedElement: View!,
    viewToGlobalMatrix: Matrix!,
    screenBounds: RectF!
): Parcelable!

Creates a snapshot of a shared element to be used by the remote Activity and reconstituted with onCreateSnapshotView(android.content.Context, android.os.Parcelable). A null return value will mean that the remote Activity will have a null snapshot View in onSharedElementStart(java.util.List, java.util.List, java.util.List) and onSharedElementEnd(java.util.List, java.util.List, java.util.List).

This is not called for Fragment Transitions.

Parameters
sharedElement View!: The shared element View to create a snapshot for.
viewToGlobalMatrix Matrix!: A matrix containing a transform from the view to the screen coordinates.
screenBounds RectF!: The bounds of shared element in screen coordinate space. This is the bounds of the view with the viewToGlobalMatrix applied.
Return
Parcelable! A snapshot to send to the remote Activity to be reconstituted with onCreateSnapshotView(android.content.Context, android.os.Parcelable) and passed into onSharedElementStart(java.util.List, java.util.List, java.util.List) and onSharedElementEnd(java.util.List, java.util.List, java.util.List).

onCreateSnapshotView

open fun onCreateSnapshotView(
    context: Context!,
    snapshot: Parcelable!
): View!

Reconstitutes a snapshot View from a Parcelable returned in onCaptureSharedElementSnapshot(android.view.View, android.graphics.Matrix, * android.graphics.RectF) to be used in onSharedElementStart(java.util.List, * java.util.List, java.util.List) and onSharedElementEnd(java.util.List, * java.util.List, java.util.List). The returned View will be sized and positioned after this call so that it is ready to be added to the decor View's overlay.

This is not called for Fragment Transitions.

Parameters
context Context!: The Context used to create the snapshot View.
snapshot Parcelable!: The Parcelable returned by onCaptureSharedElementSnapshot( * android.view.View, android.graphics.Matrix, android.graphics.RectF).
Return
View! A View to be sent in onSharedElementStart(java.util.List, java.util.List, * java.util.List) and onSharedElementEnd(java.util.List, java.util.List, * java.util.List). A null value will produce a null snapshot value for those two methods.

onMapSharedElements

open fun onMapSharedElements(
    names: MutableList<String!>!,
    sharedElements: MutableMap<String!, View!>!
): Unit

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

Parameters
names MutableList<String!>!: The names of all shared elements transferred from the calling Activity or Fragment in the order they were provided.
sharedElements MutableMap<String!, View!>!: The mapping of shared element names to Views. The best guess will be filled into sharedElements based on the transitionNames.

onRejectSharedElements

open fun onRejectSharedElements(rejectedSharedElements: MutableList<View!>!): Unit

Called after onMapSharedElements(java.util.List, java.util.Map) when transferring shared elements in. Any shared elements that have no mapping will be in rejectedSharedE