Skip to content

Commit d963121

Browse files
committed
feat(shortcuts): add adaptive icon support 🎉
1 parent 97daf87 commit d963121

File tree

8 files changed

+27
-14
lines changed

8 files changed

+27
-14
lines changed

app/src/main/res/drawable-v25/new_todo.xml

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3+
<background android:drawable="@color/lightGrey"/>
4+
<foreground>
5+
<inset
6+
android:drawable="@drawable/ic_shortcut_todo_foreground"
7+
android:inset="30%" />
8+
</foreground>
9+
</adaptive-icon>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<shape xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:shape="oval">
4+
<solid android:color="@color/lightGrey" />
5+
<size android:height="44dp" android:width="44dp" />
6+
</shape>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
3+
<item
4+
android:drawable="@drawable/ic_app_shortcut_background"
5+
android:left="2dp"
6+
android:top="2dp"
7+
android:bottom="2dp"
8+
android:right="2dp" />
9+
<item android:drawable="@drawable/ic_shortcut_todo_foreground" />
10+
</layer-list>

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

Lines changed: 0 additions & 5 deletions
This file was deleted.

app/src/main/res/values/colors.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@
88
<color name="colorOrange">#FFC107</color>
99
<color name="white">#FFF</color>
1010
<color name="colorGrey800">#424242</color>
11+
<color name="lightGrey">#fff5f5f5</color>
1112
</resources>

app/src/main/res/xml-v22/shortcuts.xml renamed to app/src/main/res/xml/shortcuts.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
xmlns:tools="http://schemas.android.com/tools">
44
<shortcut
55
android:enabled="true"
6-
android:icon="@drawable/new_todo"
6+
android:icon="@drawable/ic_shortcut_todo"
77
android:shortcutDisabledMessage="@string/shortcut_todo_disabled_msg"
88
android:shortcutId="new_todo"
99
android:shortcutLongLabel="@string/shortcut_todo_long_msg"

0 commit comments

Comments
 (0)