MaterialContainerTransformSharedElementCallback
public
class
MaterialContainerTransformSharedElementCallback
extends SharedElementCallback
java.lang.Object | ||
↳ | android.app.SharedElementCallback | |
↳ | com.google.android.material.transition.platform.MaterialContainerTransformSharedElementCallback |
A SharedElementCallback
to be used for MaterialContainerTransform
transitions.
Summary
Nested classes | |
---|---|
interface |
MaterialContainerTransformSharedElementCallback.ShapeProvider
Allows providing a |
class |
MaterialContainerTransformSharedElementCallback.ShapeableViewShapeProvider
A |
Public constructors | |
---|---|
MaterialContainerTransformSharedElementCallback()
|
Public methods | |
---|---|
MaterialContainerTransformSharedElementCallback.ShapeProvider
|
getShapeProvider()
Get the |
boolean
|
isSharedElementReenterTransitionEnabled()
Returns whether incoming Activity's sharedElementReenterTransition will be respected. |
boolean
|
isTransparentWindowBackgroundEnabled()
Returns whether the incoming window's background should be made transparent during the transition. |
Parcelable
|
onCaptureSharedElementSnapshot(View sharedElement, Matrix viewToGlobalMatrix, RectF screenBounds)
|
View
|
onCreateSnapshotView(Context context, Parcelable snapshot)
|
void
|
onMapSharedElements(List<String> names, Map<String, View> sharedElements)
|
void
|
onSharedElementEnd(List<String> sharedElementNames, List<View> sharedElements, List<View> sharedElementSnapshots)
|
void
|
onSharedElementStart(List<String> sharedElementNames, List<View> sharedElements, List<View> sharedElementSnapshots)
|
void
|
setShapeProvider(MaterialContainerTransformSharedElementCallback.ShapeProvider shapeProvider)
Set the |
void
|
setSharedElementReenterTransitionEnabled(boolean sharedElementReenterTransitionEnabled)
If enabled, the Activity's sharedElementReenterTransition will be respected; otherwise it will be set to null. |
void
|
setTransparentWindowBackgroundEnabled(boolean transparentWindowBackgroundEnabled)
If enabled, the incoming window's background will be made transparent during the transition. |
Inherited methods | |
---|---|
![]()
android.app.SharedElementCallback
| |
![]()
java.lang.Object
|
Public constructors
MaterialContainerTransformSharedElementCallback
MaterialContainerTransformSharedElementCallback ()
Public methods
getShapeProvider
MaterialContainerTransformSharedElementCallback.ShapeProvider getShapeProvider ()
Get the MaterialContainerTransformSharedElementCallback.ShapeProvider
for this callback, or null if it is not set.
Returns | |
---|---|
MaterialContainerTransformSharedElementCallback.ShapeProvider |
isSharedElementReenterTransitionEnabled
boolean isSharedElementReenterTransitionEnabled ()
Returns whether incoming Activity's sharedElementReenterTransition will be respected.
Returns | |
---|---|
boolean |
isTransparentWindowBackgroundEnabled
boolean isTransparentWindowBackgroundEnabled ()
Returns whether the incoming window's background should be made transparent during the transition.
Returns | |
---|---|
boolean |
onCaptureSharedElementSnapshot
Parcelable onCaptureSharedElementSnapshot (View sharedElement, Matrix viewToGlobalMatrix, RectF screenBounds)
Parameters | |
---|---|
sharedElement |
View |
viewToGlobalMatrix |
Matrix |
screenBounds |
RectF |
Returns | |
---|---|
Parcelable |
onCreateSnapshotView
View onCreateSnapshotView (Context context, Parcelable snapshot)
Parameters | |
---|---|
context |
Context |
snapshot |
Parcelable |
Returns | |
---|---|
View |
onMapSharedElements
void onMapSharedElements (List<String> names, Map<String, View> sharedElements)
Parameters | |
---|---|
names |
List |
sharedElements |
Map |
onSharedElementEnd
void onSharedElementEnd (List<String> sharedElementNames, List<View> sharedElements, List<View> sharedElementSnapshots)
Parameters | |
---|---|
sharedElementNames |
List |
sharedElements |
List |
sharedElementSnapshots |
List |
onSharedElementStart
void onSharedElementStart (List<String> sharedElementNames, List<View> sharedElements, List<View> sharedElementSnapshots)
Parameters | |
---|---|
sharedElementNames |
List |
sharedElements |
List |
sharedElementSnapshots |
List |
setShapeProvider
void setShapeProvider (MaterialContainerTransformSharedElementCallback.ShapeProvider shapeProvider)
Set the MaterialContainerTransformSharedElementCallback.ShapeProvider
for this callback, which allows providing a ShapeAppearanceModel
for the shared element view.
The default is a MaterialContainerTransformSharedElementCallback.ShapeableViewShapeProvider
, which will use the view's ShapeAppearanceModel
if the view implements the Shapeable
interface.
Parameters | |
---|---|
shapeProvider |
MaterialContainerTransformSharedElementCallback.ShapeProvider |
setSharedElementReenterTransitionEnabled
void setSharedElementReenterTransitionEnabled (boolean sharedElementReenterTransitionEnabled)
If enabled, the Activity's sharedElementReenterTransition will be respected; otherwise it will be set to null. Default is false, meaning the sharedElementReenterTransition will be set to null.
Parameters | |
---|---|
sharedElementReenterTransitionEnabled |
boolean |
setTransparentWindowBackgroundEnabled
void setTransparentWindowBackgroundEnabled (boolean transparentWindowBackgroundEnabled)
If enabled, the incoming window's background will be made transparent during the transition. This results in an effect where the outgoing activity's content is visible for the duration of the transition, because the incoming window background will not be faded in on top of it. Default is true.
Note: in order to avoid some visual artifacts, when this setting is enabled the window's
transition background fade duration (see setTransitionBackgroundFadeDuration(long)
) will be overridden to be greater than the
duration of the transform transition.
Parameters | |
---|---|
transparentWindowBackgroundEnabled |
boolean |
Interfaces
Classes
- FadeProvider
- FadeThroughProvider
- Hold
- MaterialArcMotion
- MaterialContainerTransform
- MaterialContainerTransform.ProgressThresholds
- MaterialContainerTransformSharedElementCallback
- MaterialContainerTransformSharedElementCallback.ShapeableViewShapeProvider
- MaterialElevationScale
- MaterialFade
- MaterialFadeThrough
- MaterialSharedAxis
- ScaleProvider
- SlideDistanceProvider
Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-08-19 UTC.