The Android Developer Challenge is back! Submit your idea before December 2.

MotionLayout reference

MotionLayout uses a motion scene file to define a motion sequence. A motion scene file is an XML file that specifies all the aspects of a motion sequence. The <MotionLayout> node in the layout file has an app:layoutDescription attribute which points to the motion scene file.

This reference is not comprehensive. It provides information on the most important motion scene file elements and their most commonly used attributes.

<MotionScene>
The root element of a motion scene file.
<ConstraintSet>
Specifies the positions and attributes of all of the views at one point in a motion sequence.
<Constraint>
Specifies the location and attributes of one of elements in a motion sequence.
<Transition>
Specifies the beginning and end states of a motion sequence, any desired intermediate states, and the user interactions that trigger the sequence.
<onClick>
Specifies the action to perform when the user taps on a specific view.
<onSwipe>
Specifies the action to perform when the user swipes on the layout.
<KeyFrameSet>
Specifies location and attributes for views over the course of the motion sequence.
<KeyPosition>
Specifies a view's location at a specific moment during the motion sequence.
<KeyAttribute>
Specifies a view's attributes at a specific moment during the motion sequence.