Skip to content
This repository was archived by the owner on Nov 21, 2019. It is now read-only.

Commit cf05e40

Browse files
authored
Replicate the YouTube's thumbnail animation. (#53)
Using percentWidth. The idea is I wanted to change the height of the image first, so until a certain frame position (90 in this case) kept the change of the width as 0 using percentWidth.
1 parent d3fccdc commit cf05e40

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

motionlayout/src/main/res/xml/scene_24.xml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,24 @@
153153

154154
<KeyPosition
155155
motion:target="@id/top_image"
156-
motion:framePosition="80"
157-
motion:curveFit="spline"
158-
motion:pathMotionArc="startHorizontal"
159-
motion:keyPositionType="deltaRelative"
160-
motion:percentX="0.3"
156+
motion:framePosition="90"
157+
motion:percentWidth="0"
158+
motion:percentX="0"
159+
motion:curveFit="linear"
160+
/>
161+
162+
<KeyPosition
163+
motion:target="@id/top_image_container"
164+
motion:framePosition="90"
165+
motion:percentWidth="0"
166+
motion:curveFit="linear"
167+
/>
168+
169+
<KeyPosition
170+
motion:target="@id/recyclerview_container"
171+
motion:framePosition="90"
172+
motion:percentWidth="0"
173+
motion:curveFit="linear"
161174
/>
162175

163176
<KeyAttribute

0 commit comments

Comments
 (0)