feat: Add adaptive icon support

Source files are in the /icons directory

Closes #430
This commit is contained in:
Sean Barbeau
2020-08-31 18:04:34 -04:00
parent b14498e3d8
commit 39f10f79e5
20 changed files with 278 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
<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="108"
android:viewportHeight="108">
<group android:scaleX="3.375"
android:scaleY="3.375"
android:translateX="13.5"
android:translateY="13.5">
<path
android:pathData="m8.0176,5.498 l-3,3.0098 2.1758,2.1758 -2.1758,1.8242 3.0566,3.0566 -3.0566,2.9434 11.3467,11.3467 13.1729,-0.001 4.6599,-2.1755 -9.6561,-9.6564 -12.5233,-12.5236 -1.9395,2.0605z"
android:strokeAlpha="0.052352943"
android:strokeLineJoin="miter"
android:strokeWidth="0"
android:strokeColor="#00000000"
android:fillAlpha="0.15"
android:strokeLineCap="butt">
<aapt:attr name="android:fillColor">
<gradient
android:startY="5.4984746"
android:startX="5.017448"
android:endY="24.072266"
android:endX="23.59124"
android:type="linear">
<item android:offset="0" android:color="#FF000000"/>
<item android:offset="1" android:color="#00000000"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="m5.0174,5.4985h3c0,1.66 -1.34,3.01 -3,3.01z"
android:fillColor="#3f51b5"/>
<path
android:pathData="m5.0174,12.5085v-2c2.76,0 5,-2.25 5,-5.01h2c0,3.87 -3.13,7.01 -7,7.01z"
android:fillColor="#3f51b5"/>
<path
android:pathData="m5.0174,18.5085 l3.5,-4.5 2.5,3.01 3.5,-4.51 4.5,6z"
android:fillColor="#3f51b5"/>
</group>
</vector>

View File

@@ -0,0 +1,29 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<group android:scaleX="3.375"
android:scaleY="3.375"
android:translateX="13.5"
android:translateY="13.5">
<path
android:pathData="M8.0176,5.498L5.0176,8.5078L7.1934,10.6836L5.0176,12.5078L8.0742,15.5645L5.0176,18.5078L10.5801,24.0723L23.9434,24.0723L23.9434,17.4238L12.0176,5.498L10.0781,7.5586L8.0176,5.498z"
android:strokeAlpha="0.03490196"
android:strokeLineJoin="miter"
android:strokeWidth="0"
android:fillColor="#000000"
android:strokeColor="#00000000"
android:fillAlpha="0.1"
android:strokeLineCap="butt"/>
<path
android:pathData="m5.0174,5.4985h3c0,1.66 -1.34,3.01 -3,3.01z"
android:fillColor="#3f51b5"/>
<path
android:pathData="m5.0174,12.5085v-2c2.76,0 5,-2.25 5,-5.01h2c0,3.87 -3.13,7.01 -7,7.01z"
android:fillColor="#3f51b5"/>
<path
android:pathData="m5.0174,18.5085 l3.5,-4.5 2.5,3.01 3.5,-4.51 4.5,6z"
android:fillColor="#3f51b5"/>
</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="@color/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="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#C5CAE9</color>
</resources>

14
icons/README.md Normal file
View File

@@ -0,0 +1,14 @@
Use inverse_satellite with web launcher icon generator:
https://romannurik.github.io/AndroidAssetStudio/icons-launcher.html#foreground.type=image&foreground.space.trim=1&foreground.space.pad=0.2&foreColor=rgba(96%2C%20125%2C%20139%2C%200)&backColor=rgb(197%2C%20202%2C%20233)&crop=0&backgroundShape=square&effects=shadow&name=ic_launcher
Trim
Padding 15%
Foreground transparent (to use SVG color #3F51B5)
Background color (#C5CAE9)
Scaling - Center
Shape - Square
Effect - Cast shadow
Generating Inkscape SVG with shadow:
1. https://www.klaasnotfound.com/2016/09/12/creating-material-icons-with-long-shadows/ and https://graphicdesign.stackexchange.com/questions/77316/creating-icons-with-long-shadows-for-android
2. Fix gradient non-stop issue by generating a "non-stop" version for import into Android Studio Image Asset adaptive icons - https://github.com/14v/svg-non-stop

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" fill="#000000" height="24" viewBox="0 0 24 24"
width="24" version="1.1" id="svg6" sodipodi:docname="inverse_satellite.svg" inkscape:version="0.92.1 r15371">
<metadata
id="metadata12">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs10" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1536"
inkscape:window-height="801"
id="namedview8"
showgrid="false"
inkscape:zoom="13.906433"
inkscape:cx="3.1558719"
inkscape:cy="14.396839"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg6" />
<path
d="M0 0h24v24H0z"
id="path2"
fill="none" />
<path
d="m 5.0174481,5.4984745 h 3 c 0,1.66 -1.34,3.01 -3,3.01 z"
id="path4493"
inkscape:connector-curvature="0"
style="fill:#3f51b5;fill-opacity:1" />
<path
d="m 5.0174481,12.508475 v -2 c 2.76,0 4.9999989,-2.2500005 4.9999989,-5.0100005 h 2 c 0,3.87 -3.1299989,7.0100005 -6.9999989,7.0100005 z"
id="path4491"
inkscape:connector-curvature="0"
style="fill:#3f51b5;fill-opacity:1" />
<path
d="m 5.0174481,18.508475 3.5,-4.5 2.4999989,3.01 3.5,-4.51 4.5,6 z"
id="path4"
inkscape:connector-curvature="0"
style="fill-opacity:1;fill:#3f51b5" />
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" fill="#000000" height="24" viewBox="0 0 24 24"
width="24" version="1.1" id="svg6" sodipodi:docname="inverse_satellite_with_shadow_gradient-v2.svg"
inkscape:version="0.92.1 r15371">
<metadata
id="metadata12">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs10">
<linearGradient
inkscape:collect="always"
id="linearGradient5863">
<stop
style="stop-color:#000000;stop-opacity:1;"
offset="0"
id="stop5859" />
<stop
style="stop-color:#000000;stop-opacity:0;"
offset="1"
id="stop5861" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5863"
id="linearGradient5865"
x1="5.0174479"
y1="5.4984746"
x2="23.59124"
y2="24.072266"
gradientUnits="userSpaceOnUse" />
</defs>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="2560"
inkscape:window-height="1346"
id="namedview8"
showgrid="false"
inkscape:zoom="32"
inkscape:cx="3.6022354"
inkscape:cy="11.286645"
inkscape:window-x="2293"
inkscape:window-y="-11"
inkscape:window-maximized="1"
inkscape:current-layer="svg6"
inkscape:object-paths="true"
inkscape:snap-intersection-paths="true"
inkscape:snap-smooth-nodes="true"
inkscape:snap-midpoints="true" />
<path
d="M0 0h24v24H0z"
id="path2"
fill="none" />
<path
style="opacity:0.15;fill:url(#linearGradient5865);fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.34901961"
d="m 8.0175781,5.4980469 -3,3.0097656 2.1757813,2.1757815 -2.1757813,1.824218 3.0566407,3.056641 -3.0566407,2.943359 11.3466799,11.34668 13.172851,-9.76e-4 4.659877,-2.1755 -9.656128,-9.656371 -12.52328,-12.5235961 -1.939453,2.0605469 z"
id="path5292"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccccccccc" />
<path
d="m 5.0174481,5.4984745 h 3 c 0,1.66 -1.34,3.01 -3,3.01 z"
id="path4493"
inkscape:connector-curvature="0"
style="fill:#3f51b5;fill-opacity:1" />
<path
d="m 5.0174481,12.508475 v -2 c 2.76,0 4.9999989,-2.2500005 4.9999989,-5.0100005 h 2 c 0,3.87 -3.1299989,7.0100005 -6.9999989,7.0100005 z"
id="path4491"
inkscape:connector-curvature="0"
style="fill:#3f51b5;fill-opacity:1" />
<path
d="m 5.0174481,18.508475 3.5,-4.5 2.4999989,3.01 3.5,-4.51 4.5,6 z"
id="path4"
inkscape:connector-curvature="0"
style="fill-opacity:1;fill:#3f51b5" />
</svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:xlink="http://www.w3.org/1999/xlink" fill="#000000" height="24" id="svg6"
inkscape:version="0.92.1 r15371" sodipodi:docname="inverse_satellite_with_shadow_gradient-v2.svg" version="1.1"
viewBox="0 0 24 24" width="24">
<metadata id="metadata12">
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<dc:title/>
</cc:Work>
</rdf:RDF>
</metadata>
<defs id="defs10">
<linearGradient id="linearGradient5863" inkscape:collect="always">
<stop id="stop5859" offset="0" style="stop-color:#000000;stop-opacity:1;"/>
<stop id="stop5861" offset="1" style="stop-color:#000000;stop-opacity:0;"/>
</linearGradient>
<linearGradient gradientUnits="userSpaceOnUse" id="linearGradient5865" inkscape:collect="always" x1="5.0174479" x2="23.59124" xlink:href="#linearGradient5863" y1="5.4984746" y2="24.072266"><stop id="stop5859" offset="0" style="stop-color:#000000;stop-opacity:1;"/><stop id="stop5861" offset="1" style="stop-color:#000000;stop-opacity:0;"/></linearGradient>
</defs>
<sodipodi:namedview bordercolor="#666666" borderopacity="1" gridtolerance="10" guidetolerance="10" id="namedview8" inkscape:current-layer="svg6" inkscape:cx="3.6022354" inkscape:cy="11.286645" inkscape:object-paths="true" inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:snap-intersection-paths="true" inkscape:snap-midpoints="true" inkscape:snap-smooth-nodes="true" inkscape:window-height="1346" inkscape:window-maximized="1" inkscape:window-width="2304" inkscape:window-x="5365" inkscape:window-y="-11" inkscape:zoom="32" objecttolerance="10" pagecolor="#ffffff" showgrid="false"/>
<path d="M0 0h24v24H0z" fill="none" id="path2"/>
<path d="m 8.0175781,5.4980469 -3,3.0097656 2.1757813,2.1757815 -2.1757813,1.824218 3.0566407,3.056641 -3.0566407,2.943359 11.3466799,11.34668 13.172851,-9.76e-4 4.659877,-2.1755 -9.656128,-9.656371 -12.52328,-12.5235961 -1.939453,2.0605469 z" id="path5292" inkscape:connector-curvature="0" sodipodi:nodetypes="ccccccccccccc" style="opacity:0.15;fill:url(#linearGradient5865);fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.34901961"/>
<path d="m 5.0174481,5.4984745 h 3 c 0,1.66 -1.34,3.01 -3,3.01 z" id="path4493" inkscape:connector-curvature="0" style="fill:#3f51b5;fill-opacity:1"/>
<path d="m 5.0174481,12.508475 v -2 c 2.76,0 4.9999989,-2.2500005 4.9999989,-5.0100005 h 2 c 0,3.87 -3.1299989,7.0100005 -6.9999989,7.0100005 z" id="path4491" inkscape:connector-curvature="0" style="fill:#3f51b5;fill-opacity:1"/>
<path d="m 5.0174481,18.508475 3.5,-4.5 2.4999989,3.01 3.5,-4.51 4.5,6 z" id="path4" inkscape:connector-curvature="0" style="fill-opacity:1;fill:#3f51b5"/>
</svg>

After

Width:  |  Height:  |  Size: 3.2 KiB