<MotionScene>
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.
Syntax
<MotionScene xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android">
...
</MotionScene>
Must contain
<Transition>
- Specifies the motion sequence to perform. If the
<MotionScene>
contains
multiple <Transition>
elements, the MotionLayout
chooses the most
appropriate <Transition>
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
<ConstraintSet>
- Specifies a beginning or ending state for one or more of the
<Transition>
nodes. The <MotionLayout>
is not permitted to have <ConstraintSet>
children, since the <Transition>
can point to XML layouts instead of
pointing to constraint sets.
Attributes
defaultDuration
- Default duration for all transitions in milliseconds. The default duration is
used for motion sequences that don't specify their own duration. For example,
if you set
defaultDuration="300"
, all motion sequences default to 300
milliseconds in length if they don't explicitly specify their own duration.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2023-02-27 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{"lastModified": "Last updated 2023-02-27 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-02-27 UTC."]]