语言

SharedElementCallback.OnCaptureSharedElementSnapshot 方法

定义

创建要由远程活动使用的共享元素的快照,并用 #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

参数

sharedElement
View

要为其创建快照的共享元素视图。

viewToGlobalMatrix
Matrix

包含从视图到屏幕坐标的转换的矩阵。

screenBounds
RectF

屏幕坐标空间中共享元素的边界。 这是应用 viewToGlobalMatrix 的视图边界。

返回

要与远程活动重新建立#onCreateSnapshotView(android.content.Context, android.os.Parcelable)并传入和传入和传递#onSharedElementStart(java.util.List, java.util.List, java.util.List)#onSharedElementEnd(java.util.List, java.util.List, java.util.List)的远程活动的快照。

特性

注解

创建远程活动要使用的共享元素的快照,并与 onCreateSnapshotView(android.content.Context, android.os.Parcelable) 重新构建。 null 返回值意味着远程活动将在 onSharedElementStart(java.util.List、java.util.List、java.util.List、java.util.List) 和 onSharedElementEnd(java.util.List,java.util.List, java.util.List, java.util.List, java.util.List) 中具有 null 快照视图。 这不用于片段转换。

Android 参考。android.app.SharedElementCallback.onCaptureSharedElementSnapshot

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于