Stay organized with collections Save and categorize content based on your preferences.

Root element of a motion scene file. The <MotionScene> contains one or more <Transition> elements, each of which defines the start and end state of a motion sequence and the transition between the two.


<MotionScene xmlns:app="http://schemas.android.com/apk/res-auto"

Must contain

Specifies the motion sequence to perform. If the <MotionScene> contains multiple <Transition> elements, the MotionLayout chooses the most appropriate based on the user's interaction. For example, a <MotionScene> might have four <Transition> children, each with an <onSwipe> for a user swipe in a different direction. When the user swipes on the screen, the MotionLayout uses the appropriate <Transition> for a swipe in that direction.

Can contain

Specifies a beginning or ending state for one or more of the <Transition> nodes. The <MotionLayout> is permitted to have zero <ConstraintSet> children, since the <Transition> can point to XML layouts instead of pointing to constraint sets.


Default duration for all transitions, in milliseconds. The default duration is used for any motion sequences that do not specify their own duration. For example, if you set defaultDuration="300", all motion sequences default to 300 milliseconds in length if they do not explicitly specify their own duration.