TransitionBuilder

public class TransitionBuilder


Builder class for creating Transition programmatically.

Summary

Public methods

static @NonNull MotionScene.Transition
buildTransition(
    @NonNull MotionScene scene,
    @NonNull int transitionId,
    @NonNull int startConstraintSetId,
    @NonNull ConstraintSet startConstraintSet,
    @NonNull int endConstraintSetId,
    @NonNull ConstraintSet endConstraintSet
)

Builder for a basic transition that transition from the startConstraintSet to the endConstraintSet.

static @NonNull void

It validates if the motion layout is setup correctly or not.

Public methods

buildTransition

@NonNull
public static MotionScene.Transition buildTransition(
    @NonNull MotionScene scene,
    @NonNull int transitionId,
    @NonNull int startConstraintSetId,
    @NonNull ConstraintSet startConstraintSet,
    @NonNull int endConstraintSetId,
    @NonNull ConstraintSet endConstraintSet
)

Builder for a basic transition that transition from the startConstraintSet to the endConstraintSet.

Parameters
@NonNull int transitionId

a unique id to represent the created transition

validate

@NonNull
public static void validate(@NonNull MotionLayout layout)

It validates if the motion layout is setup correctly or not. Use this for debugging purposes.

Returns
void

true if layout has valid scene and transition.