Aracılığıyla paylaş


SharedElementCallback.OnCaptureSharedElementSnapshot Method

Definition

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

[Android.Runtime.Register("onCaptureSharedElementSnapshot", "(Landroid/view/View;Landroid/graphics/Matrix;Landroid/graphics/RectF;)Landroid/os/Parcelable;", "GetOnCaptureSharedElementSnapshot_Landroid_view_View_Landroid_graphics_Matrix_Landroid_graphics_RectF_Handler")]
public virtual Android.OS.IParcelable? OnCaptureSharedElementSnapshot (Android.Views.View? sharedElement, Android.Graphics.Matrix? viewToGlobalMatrix, Android.Graphics.RectF? screenBounds);
[<Android.Runtime.Register("onCaptureSharedElementSnapshot", "(Landroid/view/View;Landroid/graphics/Matrix;Landroid/graphics/RectF;)Landroid/os/Parcelable;", "GetOnCaptureSharedElementSnapshot_Landroid_view_View_Landroid_graphics_Matrix_Landroid_graphics_RectF_Handler")>]
abstract member OnCaptureSharedElementSnapshot : Android.Views.View * Android.Graphics.Matrix * Android.Graphics.RectF -> Android.OS.IParcelable
override this.OnCaptureSharedElementSnapshot : Android.Views.View * Android.Graphics.Matrix * Android.Graphics.RectF -> Android.OS.IParcelable

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.

Returns

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).

Attributes

Remarks

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.

Java documentation for android.app.SharedElementCallback.onCaptureSharedElementSnapshot(android.view.View, android.graphics.Matrix, android.graphics.RectF).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to