Skip to content

Commit 2d8d428

Browse files
committed
Rework adaptive shortcut icons.
Use a single foreground on v25 & v26.
1 parent f946e81 commit 2d8d428

8 files changed

+113
-67
lines changed

app/src/main/res/drawable-v26/ic_launcher_background.xml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22
<!--
33
Copyright 2017 Google Inc.
44
5-
Licensed under the Apache License, Version 2.0 (the "License");
6-
you may not use this file except in compliance with the License.
7-
You may obtain a copy of the License at
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
87
9-
http://www.apache.org/licenses/LICENSE-2.0
8+
http://www.apache.org/licenses/LICENSE-2.0
109
11-
Unless required by applicable law or agreed to in writing, software
12-
distributed under the License is distributed on an "AS IS" BASIS,
13-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
See the License for the specific language governing permissions and
15-
limitations under the License.
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.
1614
-->
15+
1716
<vector
1817
xmlns:android="http://schemas.android.com/apk/res/android"
1918
android:width="108dp"

app/src/main/res/drawable-v26/ic_shortcut_post.xml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,8 @@
1616
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
1717
<background android:drawable="@color/light_grey" />
1818
<foreground>
19-
<vector
20-
android:width="108dp"
21-
android:height="108dp"
22-
android:viewportWidth="108"
23-
android:viewportHeight="108">
24-
<path
25-
android:pathData="M30 52v16c0 2.2 1.8 4 4 4s4-1.8 4-4V52h-8z"
26-
android:fillColor="#0E418B" />
27-
<path
28-
android:pathData="M38 68v4h-4c2.2 0 4-1.8 4-4zm0-32h36v30c0 3.32-2.7 6-6 6H38V36z"
29-
android:fillColor="#286FDC" />
30-
<path
31-
android:pathData="M53 52h-7v4h7v7h4v-7h7v-4h-7v-7h-4v7z"
32-
android:fillColor="#1750A4" />
33-
</vector>
19+
<inset
20+
android:drawable="@drawable/ic_shortcut_post_foreground"
21+
android:inset="9.26%" /> <!-- 10dp padding on each side of 108dp asset -->
3422
</foreground>
3523
</adaptive-icon>

app/src/main/res/drawable-v26/ic_shortcut_search.xml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,8 @@
1616
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
1717
<background android:drawable="@color/light_grey" />
1818
<foreground>
19-
<vector
20-
android:width="108dp"
21-
android:height="108dp"
22-
android:viewportWidth="108"
23-
android:viewportHeight="108">
24-
<path
25-
android:pathData="M60.42 57.67h-1.45l-.52-.5c1.8-2.1 2.88-4.8 2.88-7.75 0-6.58-5.33-11.92-11.9-11.92-6.6 0-11.93 5.34-11.93 11.92s5.34 11.9 11.92 11.9c2.95 0 5.66-1.07 7.75-2.86l.5.5v1.46l9.16 9.15 2.74-2.74-9.15-9.16zm-11 0c-4.57 0-8.25-3.7-8.25-8.25 0-4.57 3.68-8.25 8.25-8.25 4.56 0 8.25 3.68 8.25 8.25 0 4.56-3.7 8.25-8.25 8.25z"
26-
android:fillColor="@color/primary" />
27-
</vector>
19+
<inset
20+
android:drawable="@drawable/ic_shortcut_search_foreground"
21+
android:inset="9.26%" /> <!-- 10dp padding on each side of 108dp asset -->
2822
</foreground>
2923
</adaptive-icon>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright 2017 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+
16+
<shape
17+
xmlns:android="http://schemas.android.com/apk/res/android"
18+
android:shape="oval">
19+
<solid android:color="@color/light_grey" />
20+
<size android:width="44dp" android:height="44dp" />
21+
</shape>

app/src/main/res/drawable/ic_shortcut_post.xml

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,15 @@
1515
limitations under the License.
1616
-->
1717

18-
<vector
19-
xmlns:android="http://schemas.android.com/apk/res/android"
20-
android:width="48dp"
21-
android:height="48dp"
22-
android:viewportWidth="48"
23-
android:viewportHeight="48">
18+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
2419

25-
<path
26-
android:pathData="M24,24m-22,0a22,22 0,1 1,44 0a22,22 0,1 1,-44 0"
27-
android:fillColor="@color/light_grey" />
20+
<item
21+
android:drawable="@drawable/ic_app_shortcut_background"
22+
android:left="2dp"
23+
android:top="2dp"
24+
android:right="2dp"
25+
android:bottom="2dp" />
2826

29-
<path
30-
android:pathData="M14,23C14,23 14,30 14,30C14,31.11 14.89,32 16,32L16,32C17.1,32 18,31.1 18,30C18,30 18,23 18,23C18,23 14,23 14,23Z"
31-
android:fillColor="#0E418B" />
27+
<item android:drawable="@drawable/ic_shortcut_post_foreground" />
3228

33-
<path
34-
android:pathData="M18,32L16.22,32C16.22,32 16.22,32 16.22,31.99C17.17,31.88 17.91,31.12 17.99,30.17C18,30.17 18,30.17 18,30.17C18,26.16 18,17 18,17C18,17 33.95,17 33.95,17L33.95,26.01C33.95,29.32 31.26,32 27.94,32L18,32Z"
35-
android:fillColor="#286FDC" />
36-
37-
<path
38-
android:pathData="M24.76,23.5L21.76,23.5L21.76,25.5L24.76,25.5L24.76,28.5L26.76,28.5L26.76,25.5L29.76,25.5L29.76,23.5L26.76,23.5L26.76,20.5L24.76,20.5L24.76,23.5Z"
39-
android:fillColor="#1750A4" />
40-
41-
</vector>
29+
</layer-list>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright 2017 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+
16+
<vector
17+
xmlns:android="http://schemas.android.com/apk/res/android"
18+
android:width="48dp"
19+
android:height="48dp"
20+
android:viewportWidth="48"
21+
android:viewportHeight="48">
22+
23+
<path
24+
android:pathData="M14,23C14,23 14,30 14,30C14,31.11 14.89,32 16,32L16,32C17.1,32 18,31.1 18,30C18,30 18,23 18,23C18,23 14,23 14,23Z"
25+
android:fillColor="#0E418B" />
26+
27+
<path
28+
android:pathData="M18,32L16.22,32C16.22,32 16.22,32 16.22,31.99C17.17,31.88 17.91,31.12 17.99,30.17C18,30.17 18,30.17 18,30.17C18,26.16 18,17 18,17C18,17 33.95,17 33.95,17L33.95,26.01C33.95,29.32 31.26,32 27.94,32L18,32Z"
29+
android:fillColor="#286FDC" />
30+
31+
<path
32+
android:pathData="M24.76,23.5L21.76,23.5L21.76,25.5L24.76,25.5L24.76,28.5L26.76,28.5L26.76,25.5L29.76,25.5L29.76,23.5L26.76,23.5L26.76,20.5L24.76,20.5L24.76,23.5Z"
33+
android:fillColor="#1750A4" />
34+
35+
</vector>

app/src/main/res/drawable/ic_shortcut_search.xml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,15 @@
1515
limitations under the License.
1616
-->
1717

18-
<vector
19-
xmlns:android="http://schemas.android.com/apk/res/android"
20-
android:width="48dp"
21-
android:height="48dp"
22-
android:viewportWidth="48"
23-
android:viewportHeight="48">
18+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
2419

25-
<path
26-
android:pathData="M24,24m-22,0a22,22 0,1 1,44 0a22,22 0,1 1,-44 0"
27-
android:fillColor="@color/light_grey" />
20+
<item
21+
android:drawable="@drawable/ic_app_shortcut_background"
22+
android:left="2dp"
23+
android:top="2dp"
24+
android:right="2dp"
25+
android:bottom="2dp" />
2826

29-
<path
30-
android:pathData="M27.5,26L26.71,26L26.43,25.73C27.41,24.59 28,23.11 28,21.5C28,17.91 25.09,15 21.5,15C17.91,15 15,17.91 15,21.5C15,25.09 17.91,28 21.5,28C23.11,28 24.59,27.41 25.73,26.43L26,26.71L26,27.5L31,32.49L32.49,31L27.5,26L27.5,26ZM21.5,26C19.01,26 17,23.99 17,21.5C17,19.01 19.01,17 21.5,17C23.99,17 26,19.01 26,21.5C26,23.99 23.99,26 21.5,26L21.5,26Z"
31-
android:fillColor="@color/primary" />
27+
<item android:drawable="@drawable/ic_shortcut_search_foreground" />
3228

33-
</vector>
29+
</layer-list>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright 2017 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+
16+
<vector
17+
xmlns:android="http://schemas.android.com/apk/res/android"
18+
android:width="48dp"
19+
android:height="48dp"
20+
android:viewportWidth="48"
21+
android:viewportHeight="48">
22+
<path
23+
android:pathData="M27.5,26L26.71,26L26.43,25.73C27.41,24.59 28,23.11 28,21.5C28,17.91 25.09,15 21.5,15C17.91,15 15,17.91 15,21.5C15,25.09 17.91,28 21.5,28C23.11,28 24.59,27.41 25.73,26.43L26,26.71L26,27.5L31,32.49L32.49,31L27.5,26L27.5,26ZM21.5,26C19.01,26 17,23.99 17,21.5C17,19.01 19.01,17 21.5,17C23.99,17 26,19.01 26,21.5C26,23.99 23.99,26 21.5,26L21.5,26Z"
24+
android:fillColor="@color/primary" />
25+
</vector>

0 commit comments

Comments
 (0)