TransitionBuilder

public class TransitionBuilder
extends Object

java.lang.Object
   ↳ androidx.constraintlayout.motion.widget.TransitionBuilder


Builder class for creating MotionScene.Transition programmatically.

Summary

Public constructors

TransitionBuilder()

Public methods

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

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

static void validate(MotionLayout layout)

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

Inherited methods

Public constructors

TransitionBuilder

public TransitionBuilder ()

Public methods

buildTransition

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

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

Parameters
scene MotionScene

transitionId int: a unique id to represent the created transition

startConstraintSetId int

startConstraintSet ConstraintSet

endConstraintSetId int

endConstraintSet ConstraintSet

Returns
MotionScene.Transition

validate

public static void validate (MotionLayout layout)

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

Parameters
layout MotionLayout

Returns
void true if layout has valid scene and transition.