Skip to content

Commit 03d6294

Browse files
committed
add changing path
1 parent 6abdcc2 commit 03d6294

File tree

3 files changed

+30
-8
lines changed

3 files changed

+30
-8
lines changed

15-milky-way/app/src/main/res/layout/activity_step3.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
xmlns:tools="http://schemas.android.com/tools"
1919
android:layout_width="match_parent"
2020
android:layout_height="match_parent"
21-
app:layoutDescription="@xml/step3">
21+
app:layoutDescription="@xml/step3"
22+
app:motionDebug="SHOW_PATH">
2223

2324

2425
<ImageView

15-milky-way/app/src/main/res/xml/step3.xml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,14 @@
2626
motion:targetId="@id/moon"
2727
motion:clickAction="toggle"
2828
/>
29-
30-
<!-- TODO: Add KeyFrameSet and KeyPosition -->
29+
<KeyFrameSet>
30+
<KeyPosition
31+
motion:framePosition="50"
32+
motion:motionTarget="@id/moon"
33+
motion:keyPositionType="parentRelative"
34+
motion:percentY="0.5"
35+
/>
36+
</KeyFrameSet>
3137
</Transition>
3238

3339
<!-- Constraints to apply at the start of the animation -->

15-milky-way/app/src/main/res/xml/step4.xml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,27 @@
3030

3131
<KeyFrameSet>
3232
<KeyPosition
33-
motion:framePosition="50"
34-
motion:motionTarget="@id/moon"
35-
motion:keyPositionType="parentRelative"
36-
motion:percentY="0.5"
33+
motion:framePosition="25"
34+
motion:motionTarget="@id/moon"
35+
motion:keyPositionType="parentRelative"
36+
motion:percentY="0.6"
37+
motion:percentX="0.1"
38+
/>
39+
<KeyPosition
40+
motion:framePosition="50"
41+
motion:motionTarget="@id/moon"
42+
motion:keyPositionType="parentRelative"
43+
motion:percentY="0.5"
44+
motion:percentX="0.3"
3745
/>
38-
<!-- TODO: Add two more KeyPositions to the KeyFrameSet here -->
46+
<KeyPosition
47+
motion:framePosition="75"
48+
motion:motionTarget="@id/moon"
49+
motion:keyPositionType="parentRelative"
50+
motion:percentY="0.6"
51+
motion:percentX="0.1"
52+
/>
53+
3954

4055
</KeyFrameSet>
4156
</Transition>

0 commit comments

Comments
 (0)