43.8 Adding Position Keyframes
The final task for this tutorial is to add two position keyframes (KeyPosition) to the animation path to introduce some lateral movement in to the animation. With the transition timeline visible in the MotionLayout editor, click on the button to create a keyframe as highlighed in Figure 43-13 above and select the KeyPosition option from the menu as shown in Figure 43-21 below:
Figure 43-21
In the resulting dialog, set the properties as illustrated in Figure 43-22:
Figure 43-22
Click on the Add button to commit the change, then repeat the above steps to add a second position keyframe configured as follows:
•Position: 75
•Type: parentRelative
•PercentX: 0.85
•PercentY: 0.75
On completion of these changes, the following keyframe entries will have been added to the transition element in the activity_main_scene.xml file:
<KeyFrameSet>
.
.
<KeyPosition
...