<KeyAttribute>
Stay organized with collections
Save and categorize content based on your preferences.
Specifies view attributes at a specific moment during the motion sequence. You
can use <KeyAttribute>
to set the view's standard attributes.
Suppose a view's opacity (android:alpha
) is set to 0 in the initial
<ConstraintSet>
and 1 in the final <ConstraintSet>
. By default, this makes
the view linearly fade in for the entire motion sequence. If you want the view
to remain invisible for 80% of the motion sequence and then fade in quickly, add
a <KeyAttribute>
node with the motion:framePosition
attribute set to 80 and
the android:alpha
attribute set to 0.
Syntax
<KeyAttribute
motion:motionTarget="@id/targetPath"
motion:framePosition="percentage"
[ attribute = value ]
/>
Attributes
motion:motionTarget
- View whose attributes are controlled by this
<KeyAttribute>
.
motion:framePosition
- Integer from 1 to 99 specifying when in the motion sequence the view has the
attributes specified by this
<KeyAttribute>
. For example, if framePosition
is 25, then the view has the specified attributes one-quarter of the way
through the motion sequence.
You can set the following view attributes. For more information about these
attributes, see the View
reference page.
android:alpha
android:elevation
android:rotation
android:rotationX
android:rotationY
android:scaleX
android:scaleY
android:translationX
android:translationY
android:translationZ
android:visibility
transitionPathRotate
Contained in
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-03-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-03-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-03-27 UTC."]]