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

Commit cca462d

Browse files
committed
Animate bottom nav icons.
Awww yeah. Thanks Jonas! Change-Id: I1f3600831e251bfee7940098790851f566244798
1 parent 5ed1a79 commit cca462d

File tree

11 files changed

+1804
-7
lines changed

11 files changed

+1804
-7
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright (c) 2019 Google Inc.
4+
5+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
6+
in compliance with the License. You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software distributed under the License
11+
is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12+
or implied. See the License for the specific language governing permissions and limitations under
13+
the License.
14+
-->
15+
<animated-selector xmlns:android="http://schemas.android.com/apk/res/android">
16+
17+
<item
18+
android:id="@+id/selected"
19+
android:state_checked="true"
20+
android:drawable="@drawable/ic_featured"/>
21+
22+
<item
23+
android:id="@+id/unselected"
24+
android:drawable="@drawable/ic_featured"/>
25+
26+
<transition
27+
android:fromId="@+id/unselected"
28+
android:toId="@+id/selected"
29+
android:drawable="@drawable/avd_featured_on"/>
30+
31+
<transition
32+
android:fromId="@+id/selected"
33+
android:toId="@+id/unselected"
34+
android:drawable="@drawable/avd_featured_off"/>
35+
36+
</animated-selector>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright (c) 2019 Google Inc.
4+
5+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
6+
in compliance with the License. You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software distributed under the License
11+
is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12+
or implied. See the License for the specific language governing permissions and limitations under
13+
the License.
14+
-->
15+
<animated-selector xmlns:android="http://schemas.android.com/apk/res/android">
16+
17+
<item
18+
android:id="@+id/selected"
19+
android:state_checked="true"
20+
android:drawable="@drawable/ic_my_courses"/>
21+
22+
<item
23+
android:id="@+id/unselected"
24+
android:drawable="@drawable/ic_my_courses"/>
25+
26+
<transition
27+
android:fromId="@+id/unselected"
28+
android:toId="@+id/selected"
29+
android:drawable="@drawable/avd_my_courses_on"/>
30+
31+
<transition
32+
android:fromId="@+id/selected"
33+
android:toId="@+id/unselected"
34+
android:drawable="@drawable/avd_my_courses_off"/>
35+
36+
</animated-selector>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright (c) 2019 Google Inc.
4+
5+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
6+
in compliance with the License. You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software distributed under the License
11+
is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12+
or implied. See the License for the specific language governing permissions and limitations under
13+
the License.
14+
-->
15+
<animated-selector xmlns:android="http://schemas.android.com/apk/res/android">
16+
17+
<item
18+
android:id="@+id/selected"
19+
android:state_checked="true"
20+
android:drawable="@drawable/ic_search"/>
21+
22+
<item
23+
android:id="@+id/unselected"
24+
android:drawable="@drawable/ic_search"/>
25+
26+
<transition
27+
android:fromId="@+id/unselected"
28+
android:toId="@+id/selected"
29+
android:drawable="@drawable/avd_search_on"/>
30+
31+
<transition
32+
android:fromId="@+id/selected"
33+
android:toId="@+id/unselected"
34+
android:drawable="@drawable/avd_search_off"/>
35+
36+
</animated-selector>
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright (c) 2019 Google Inc.
4+
5+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
6+
in compliance with the License. You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software distributed under the License
11+
is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12+
or implied. See the License for the specific language governing permissions and limitations under
13+
the License.
14+
-->
15+
<animated-vector
16+
xmlns:android="http://schemas.android.com/apk/res/android"
17+
xmlns:aapt="http://schemas.android.com/aapt">
18+
<aapt:attr name="android:drawable">
19+
<vector android:height="24dp"
20+
android:width="24dp"
21+
android:viewportHeight="24"
22+
android:viewportWidth="24">
23+
<group android:name="_R_G">
24+
<group android:name="_R_G_L_1_G"
25+
android:translateX="-18.79"
26+
android:translateY="-18.292"
27+
android:pivotX="30.79"
28+
android:pivotY="30.292"
29+
android:scaleX="0.2798"
30+
android:scaleY="0.2798">
31+
<path android:name="_R_G_L_1_G_D_0_P_0"
32+
android:fillColor="#ffde03"
33+
android:fillAlpha="1"
34+
android:fillType="nonZero"
35+
android:pathData=" M50.81 30.34 C50.81,24.34 48.89,19.22 45.04,14.98 C41.18,10.74 36.45,8.63 30.83,8.63 C25.22,8.63 20.48,10.74 16.63,14.98 C12.78,19.22 10.85,24.34 10.85,30.34 C10.85,36.34 12.78,41.45 16.63,45.65 C20.48,49.86 25.22,51.96 30.83,51.96 C36.45,51.96 41.18,49.86 45.04,45.65 C48.89,41.45 50.81,36.34 50.81,30.34c M52.51 51.72 C46.63,57.46 39.39,60.33 30.79,60.33 C22.19,60.33 14.95,57.46 9.07,51.72 C3.19,45.98 0.25,38.84 0.25,30.29 C0.25,21.75 3.19,14.6 9.07,8.86 C14.95,3.12 22.19,0.25 30.79,0.25 C39.39,0.25 46.63,3.12 52.51,8.86 C58.39,14.6 61.33,21.75 61.33,30.29 C61.33,38.84 58.39,45.98 52.51,51.72c "/>
36+
</group>
37+
<group android:name="_R_G_L_0_G_N_2_T_0"
38+
android:translateX="-18.79"
39+
android:translateY="-18.292"
40+
android:pivotX="30.79"
41+
android:pivotY="30.292"
42+
android:scaleX="0.2798"
43+
android:scaleY="0.2798">
44+
<group android:name="_R_G_L_0_G"
45+
android:translateX="22.095"
46+
android:translateY="21.277">
47+
<path android:name="_R_G_L_0_G_D_0_P_0"
48+
android:fillColor="#ffde03"
49+
android:fillAlpha="1"
50+
android:fillType="nonZero"
51+
android:pathData=" M16.89 8.57 C16.89,3.98 13.17,0.25 8.57,0.25 C3.98,0.25 0.25,3.98 0.25,8.57 C0.25,13.17 3.98,16.89 8.57,16.89 C13.17,16.89 16.89,13.17 16.89,8.57c "/>
52+
</group>
53+
</group>
54+
</group>
55+
<group android:name="time_group"/>
56+
</vector>
57+
</aapt:attr>
58+
<target android:name="_R_G_L_1_G_D_0_P_0">
59+
<aapt:attr name="android:animation">
60+
<set android:ordering="together">
61+
<objectAnimator android:propertyName="fillColor"
62+
android:duration="167"
63+
android:startOffset="0"
64+
android:valueFrom="#ffde03"
65+
android:valueTo="#ffffff"
66+
android:valueType="colorType">
67+
<aapt:attr name="android:interpolator">
68+
<pathInterpolator android:pathData="M 0.0,0.0 c0.167,0.167 0.833,0.833 1.0,1.0"/>
69+
</aapt:attr>
70+
</objectAnimator>
71+
</set>
72+
</aapt:attr>
73+
</target>
74+
<target android:name="_R_G_L_0_G_D_0_P_0">
75+
<aapt:attr name="android:animation">
76+
<set android:ordering="together">
77+
<objectAnimator android:propertyName="fillColor"
78+
android:duration="167"
79+
android:startOffset="0"
80+
android:valueFrom="#ffde03"
81+
android:valueTo="#ffffff"
82+
android:valueType="colorType">
83+
<aapt:attr name="android:interpolator">
84+
<pathInterpolator android:pathData="M 0.0,0.0 c0.167,0.167 0.833,0.833 1.0,1.0"/>
85+
</aapt:attr>
86+
</objectAnimator>
87+
</set>
88+
</aapt:attr>
89+
</target>
90+
<target android:name="time_group">
91+
<aapt:attr name="android:animation">
92+
<set android:ordering="together">
93+
<objectAnimator android:propertyName="translateX"
94+
android:duration="183"
95+
android:startOffset="0"
96+
android:valueFrom="0"
97+
android:valueTo="1"
98+
android:valueType="floatType"/>
99+
</set>
100+
</aapt:attr>
101+
</target>
102+
</animated-vector>

0 commit comments

Comments
 (0)