Add adaptive icons, fixes #2273

Add support for adaptive icons in devices running API 26 or greater, preserving old icon for older devices and providing round icon.
This commit is contained in:
Kowalski Prime 2018-07-13 01:24:28 +02:00
parent 4f4be8ed47
commit 17f3db6557
18 changed files with 142 additions and 0 deletions

View File

@ -0,0 +1,43 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="2461.157"
android:viewportHeight="2461.157">
<group android:translateX="-258.42148"
android:translateY="-258.42148">
<group>
<clip-path android:pathData="M0,0h2978v2978h-2978z M 0,0"/>
<path
android:pathData="M1472.59,1249.55c0,0 3.817,3.236 10.352,10.352l54.412,54.412l430.297,0l1663.63,1663.69l-1388.05,0l-1249.55,-1249.55l0.001,-0.001l96.383,-96.383l-192.048,-192.048c10.166,-70.097 41.824,-133.272 88.065,-182.618l239.324,239.324l247.181,-247.18Z">
<aapt:attr name="android:fillColor">
<gradient
android:startY="1272"
android:startX="308.67"
android:endY="2825.5"
android:endX="1862.17"
android:type="linear">
<item android:offset="0" android:color="#FF000000"/>
<item android:offset="0.47" android:color="#38000000"/>
<item android:offset="1" android:color="#00000000"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M1055.61,1200.51c51.688,-31.936 112.582,-50.371 177.749,-50.371c123.135,0 231.018,65.82 290.355,164.168l443.94,0l115.848,115.873l0,58.816l-115.848,115.873l-95.214,0l-47.492,-91.206l-13.937,0l-47.492,91.206l-14.214,0l-47.492,-91.206l-13.937,0l-47.493,91.206l-88.528,0c-47.376,130.031 -172.166,222.984 -318.496,222.984c-65.422,0 -126.539,-18.58 -178.357,-50.747l-0.564,-0.351c-95.999,-59.853 -159.936,-166.398 -159.936,-287.759c0,-121.598 64.188,-228.323 160.5,-288.11l0.608,-0.376Zm-1.033,201.418c-36.056,10.698 -62.388,44.105 -62.388,83.614c0,39.663 26.538,73.177 62.813,83.738c7.74,2.253 15.923,3.462 24.386,3.462c48.127,0 87.2,-39.073 87.2,-87.2c0,-48.127 -39.073,-87.2 -87.2,-87.2c-8.463,0 -16.646,1.208 -24.386,3.461l-0.425,0.125Z"
android:fillColor="#818080"/>
<group>
<clip-path android:pathData="M1055.61,1200.51c51.688,-31.936 112.582,-50.371 177.749,-50.371c123.135,0 231.018,65.82 290.355,164.168l443.94,0l115.848,115.873l0,58.816l-115.848,115.873l-95.214,0l-47.492,-91.206l-13.937,0l-47.492,91.206l-14.214,0l-47.492,-91.206l-13.937,0l-47.493,91.206l-88.528,0c-47.376,130.031 -172.166,222.984 -318.496,222.984c-65.422,0 -126.539,-18.58 -178.357,-50.747l-0.564,-0.351c-95.999,-59.853 -159.936,-166.398 -159.936,-287.759c0,-121.598 64.188,-228.323 160.5,-288.11l0.608,-0.376Zm-1.033,201.418c-36.056,10.698 -62.388,44.105 -62.388,83.614c0,39.663 26.538,73.177 62.813,83.738c7.74,2.253 15.923,3.462 24.386,3.462c48.127,0 87.2,-39.073 87.2,-87.2c0,-48.127 -39.073,-87.2 -87.2,-87.2c-8.463,0 -16.646,1.208 -24.386,3.461l-0.425,0.125Z M 0,0"/>
<path
android:pathData="M1447.79,1168.16h662.418v634.775h-662.418z"
android:fillColor="#c1bebe"/>
<path
android:pathData="M2083.5,1396.84l0,71.871l-563.339,0l0,-92.98l347.261,0l21.109,21.109l194.969,0Z"
android:fillColor="#989898"/>
<path
android:pathData="M1447.79,1429.51h662.418v373.427h-662.418z"
android:fillColor="#dddbda"/>
</group>
</group>
</group>
</vector>

View File

@ -0,0 +1,18 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="1428.5714"
android:viewportHeight="1428.5714">
<group android:translateX="-35.714287"
android:translateY="-35.714287">
<group>
<clip-path android:pathData="M0,0h1500v1500h-1500z M 0,0"/>
<path
android:pathData="M0.0,0.0h1500.0v1500.0h-1500.0z"
android:fillColor="#3f51b5"/>
<path
android:pathData="M0,1500l1500,-1500l0,1500l-1500,0Z"
android:fillColor="#3949ab"/>
</group>
</group>
</vector>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -0,0 +1,43 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="2461.157"
android:viewportHeight="2461.157">
<group android:translateX="-258.42148"
android:translateY="-258.42148">
<group>
<clip-path android:pathData="M0,0h2978v2978h-2978z M 0,0"/>
<path
android:pathData="M1472.59,1249.55c0,0 3.817,3.236 10.352,10.352l54.412,54.412l430.297,0l1663.63,1663.69l-1388.05,0l-1249.55,-1249.55l0.001,-0.001l96.383,-96.383l-192.048,-192.048c10.166,-70.097 41.824,-133.272 88.065,-182.618l239.324,239.324l247.181,-247.18Z">
<aapt:attr name="android:fillColor">
<gradient
android:startY="1272"
android:startX="308.67"
android:endY="2825.5"
android:endX="1862.17"
android:type="linear">
<item android:offset="0" android:color="#FF000000"/>
<item android:offset="0.47" android:color="#38000000"/>
<item android:offset="1" android:color="#00000000"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M1055.61,1200.51c51.688,-31.936 112.582,-50.371 177.749,-50.371c123.135,0 231.018,65.82 290.355,164.168l443.94,0l115.848,115.873l0,58.816l-115.848,115.873l-95.214,0l-47.492,-91.206l-13.937,0l-47.492,91.206l-14.214,0l-47.492,-91.206l-13.937,0l-47.493,91.206l-88.528,0c-47.376,130.031 -172.166,222.984 -318.496,222.984c-65.422,0 -126.539,-18.58 -178.357,-50.747l-0.564,-0.351c-95.999,-59.853 -159.936,-166.398 -159.936,-287.759c0,-121.598 64.188,-228.323 160.5,-288.11l0.608,-0.376Zm-1.033,201.418c-36.056,10.698 -62.388,44.105 -62.388,83.614c0,39.663 26.538,73.177 62.813,83.738c7.74,2.253 15.923,3.462 24.386,3.462c48.127,0 87.2,-39.073 87.2,-87.2c0,-48.127 -39.073,-87.2 -87.2,-87.2c-8.463,0 -16.646,1.208 -24.386,3.461l-0.425,0.125Z"
android:fillColor="#818080"/>
<group>
<clip-path android:pathData="M1055.61,1200.51c51.688,-31.936 112.582,-50.371 177.749,-50.371c123.135,0 231.018,65.82 290.355,164.168l443.94,0l115.848,115.873l0,58.816l-115.848,115.873l-95.214,0l-47.492,-91.206l-13.937,0l-47.492,91.206l-14.214,0l-47.492,-91.206l-13.937,0l-47.493,91.206l-88.528,0c-47.376,130.031 -172.166,222.984 -318.496,222.984c-65.422,0 -126.539,-18.58 -178.357,-50.747l-0.564,-0.351c-95.999,-59.853 -159.936,-166.398 -159.936,-287.759c0,-121.598 64.188,-228.323 160.5,-288.11l0.608,-0.376Zm-1.033,201.418c-36.056,10.698 -62.388,44.105 -62.388,83.614c0,39.663 26.538,73.177 62.813,83.738c7.74,2.253 15.923,3.462 24.386,3.462c48.127,0 87.2,-39.073 87.2,-87.2c0,-48.127 -39.073,-87.2 -87.2,-87.2c-8.463,0 -16.646,1.208 -24.386,3.461l-0.425,0.125Z M 0,0"/>
<path
android:pathData="M1447.79,1168.16h662.418v634.775h-662.418z"
android:fillColor="#c1bebe"/>
<path
android:pathData="M2083.5,1396.84l0,71.871l-563.339,0l0,-92.98l347.261,0l21.109,21.109l194.969,0Z"
android:fillColor="#989898"/>
<path
android:pathData="M1447.79,1429.51h662.418v373.427h-662.418z"
android:fillColor="#dddbda"/>
</group>
</group>
</group>
</vector>

View File

@ -0,0 +1,18 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="1428.5714"
android:viewportHeight="1428.5714">
<group android:translateX="-35.714287"
android:translateY="-35.714287">
<group>
<clip-path android:pathData="M0,0h1500v1500h-1500z M 0,0"/>
<path
android:pathData="M0.0,0.0h1500.0v1500.0h-1500.0z"
android:fillColor="#95c060"/>
<path
android:pathData="M0,1500l1500,-1500l0,1500l-1500,0Z"
android:fillColor="#7cad44"/>
</group>
</group>
</vector>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB