Skip to content

Commit

Permalink
Use adaptive launcher icon
Browse files Browse the repository at this point in the history
Replace android:icon="@drawable/icon" with android:icon="@mipmap/icon"
icon_foreground is converted from SerialTest-nobg-scaled.svg
icon_monochrome is converted from SerialTest-nobg-notext-scaled.svg
The scale factor is 0.65

Thanks @xmha97 and @sebastien46 for providing ideas!
  • Loading branch information
wh201906 committed Jan 28, 2024
1 parent 10fc7a8 commit da9f2ca
Show file tree
Hide file tree
Showing 13 changed files with 87 additions and 4 deletions.
29 changes: 25 additions & 4 deletions src/android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<?xml version="1.0"?>
<manifest package="priv.wh201906.serialtest" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="V0.3.3" android:versionCode="33" android:installLocation="auto">
<manifest
package="priv.wh201906.serialtest"
xmlns:android="http://schemas.android.com/apk/res/android"
android:versionName="V0.3.3"
android:versionCode="33"
android:installLocation="auto">
<!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.
Remove the comment if you do not require these default permissions. -->
<!-- %%INSERT_PERMISSIONS -->
Expand All @@ -8,9 +13,25 @@
Remove the comment if you do not require these default features. -->
<!-- %%INSERT_FEATURES -->

<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
<application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="SerialTest" android:extractNativeLibs="true" android:largeHeap="true" android:icon="@drawable/icon">
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density" android:name="priv.wh201906.serialtest.MainActivity" android:label="SerialTest" android:launchMode="singleTask" android:screenOrientation="unspecified">
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:anyDensity="true"
android:smallScreens="true"/>
<application
android:hardwareAccelerated="true"
android:name="org.qtproject.qt5.android.bindings.QtApplication"
android:label="SerialTest"
android:extractNativeLibs="true"
android:largeHeap="true"
android:icon="@mipmap/icon"
android:roundIcon="@mipmap/icon">
<activity
android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density"
android:name="priv.wh201906.serialtest.MainActivity"
android:label="SerialTest"
android:launchMode="singleTask"
android:screenOrientation="unspecified">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
Expand Down
16 changes: 16 additions & 0 deletions src/android/res/drawable/icon_foreground.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<vector android:height="108dp" android:viewportHeight="500"
android:viewportWidth="500" android:width="108dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#38b6ff" android:pathData="M280.9,125C291.27,123.83 301.89,126.15 311.11,130.96C321.69,136.72 330.05,146.42 334.21,157.73C338.22,168.57 338.57,180.81 334.81,191.77C332.84,197.87 329.53,203.47 325.45,208.39C321.61,212.58 317.52,216.54 313.53,220.58C311.4,222.84 308.3,224.12 305.18,223.78C299.56,223.6 295.16,217.81 295.91,212.35C296.19,209.97 297.47,207.84 299.13,206.17C301.82,203.45 304.58,200.78 307.28,198.08C312.43,193.07 316.05,186.35 316.83,179.16C318.03,168.99 313.91,158.22 305.88,151.78C297.13,144.36 284.03,142.55 273.65,147.48C269.26,149.27 265.71,152.48 262.48,155.86C253.52,164.88 244.53,173.88 235.59,182.91C231.29,187.31 228.19,192.92 227.13,199C225.92,206.05 227.17,213.54 230.8,219.72C233.79,224.81 238.39,228.6 242.45,232.79C244.87,235.36 248.01,237.6 248.97,241.17C250.14,244.92 248.56,249.06 245.75,251.65C241.96,255.06 235.54,254.8 232.01,251.13C227.78,246.93 223.59,242.67 219.43,238.4C205.01,222.76 202.37,197.73 213.09,179.38C217.33,171.56 224.21,165.77 230.37,159.53C237.59,152.44 244.72,145.26 251.99,138.23C259.76,130.66 270.25,126.41 280.9,125Z"/>
<path android:fillColor="#38b6ff" android:pathData="M252.88,185.33C255.67,184.54 258.75,185.24 261.1,186.88C262.9,188.3 264.44,190.02 266.11,191.59C270.57,196.04 275.43,200.2 278.99,205.46C284.29,212.97 287.43,221.95 288.03,231.12C289.27,246.41 283.03,262.04 271.64,272.31C262.2,281.51 252.78,290.72 243.3,299.89C235.43,307.42 225.22,312.5 214.38,313.86C202.28,315.5 189.54,312.58 179.44,305.67C166.85,297.44 158.43,283.21 157.1,268.24C157.07,263.23 156.68,258.13 157.83,253.2C159.14,247.04 161.46,241.06 164.96,235.8C169.36,229.08 175.44,223.72 181.02,218.01C184.75,214.26 191.25,214.16 195.11,217.76C199.03,221.24 199.52,227.82 195.98,231.73C192.88,235.12 189.47,238.22 186.27,241.5C180.08,247.54 176.54,256.26 177.03,264.92C177.39,274.41 182.49,283.57 190.41,288.82C199.98,295.71 213.64,296.12 223.64,289.92C226.16,288.4 228.45,286.53 230.54,284.46C239.42,275.59 248.32,266.72 257.21,257.86C260.79,254.33 264.02,250.27 265.77,245.51C268.84,237.72 268.28,228.67 264.54,221.22C261.52,215 256.03,210.61 251.38,205.68C249.17,203.36 246.42,201.24 245.53,198.02C243.81,192.72 247.52,186.58 252.88,185.33Z"/>
<path android:fillColor="#000000" android:pathData="M257.19,334.23C258.61,334.22 260.02,334.22 261.43,334.22C261.45,346.45 261.43,358.67 261.44,370.89C260.02,370.89 258.61,370.89 257.19,370.9C257.19,358.67 257.19,346.45 257.19,334.23Z"/>
<path android:fillColor="#000000" android:pathData="M219.08,335.47C220.87,334.84 222.76,336.55 222.32,338.42C222.37,340.62 219.31,341.49 217.93,339.94C216.91,338.56 217.17,335.93 219.08,335.47Z"/>
<path android:fillColor="#000000" android:pathData="M150.22,336.36C154.63,335.44 159.25,336.23 163.39,337.87C162.95,339.11 162.5,340.35 162.05,341.58C158.41,340.21 154.33,339.11 150.49,340.28C148.26,340.95 146.92,343.36 147.31,345.63C147.43,347.64 149.02,349.14 150.72,349.99C154.4,351.93 158.79,352.69 161.89,355.66C164.42,358.07 164.71,362.06 163.6,365.22C162.3,368.74 158.54,370.64 155.02,371.14C150.8,371.67 146.44,371.29 142.44,369.8C142.44,368.42 142.44,367.03 142.44,365.65C146.96,367.26 152.15,368.55 156.8,366.75C160.21,365.46 160.97,360.29 158.1,358.08C154.35,355.26 149.27,354.84 145.74,351.65C143.06,349.39 142.36,345.43 143.26,342.16C144.19,339.06 147.16,337.02 150.22,336.36Z"/>
<path android:fillColor="#000000" android:pathData="M265.92,336.45C274.52,336.45 283.13,336.45 291.73,336.45C291.73,337.72 291.73,338.98 291.73,340.26C288.16,340.26 284.59,340.26 281.03,340.26C281.03,350.47 281.02,360.69 281.03,370.9C279.57,370.89 278.13,370.89 276.68,370.9C276.68,360.69 276.68,350.48 276.68,340.26C273.09,340.26 269.51,340.26 265.92,340.26C265.92,338.99 265.92,337.72 265.92,336.45Z"/>
<path android:fillColor="#000000" android:pathData="M348.8,339.1C349.63,339.1 350.47,339.1 351.31,339.1C351.31,341.08 351.31,343.05 351.31,345.03C353.8,345.03 356.3,345.03 358.8,345.04C358.79,346.13 358.79,347.23 358.79,348.33C356.29,348.32 353.8,348.33 351.31,348.33C351.32,353.25 351.29,358.17 351.32,363.1C351.3,364.6 351.61,366.34 352.98,367.22C354.79,368.42 357.04,367.7 359.02,367.47C358.99,368.57 358.97,369.68 358.93,370.78C356.03,371.47 352.75,371.85 350.07,370.26C347.86,368.92 347.07,366.23 347.08,363.79C347.03,358.63 347.08,353.48 347.06,348.33C345.84,348.33 344.61,348.32 343.39,348.32C343.4,347.81 343.4,346.79 343.4,346.28C344.64,345.73 345.88,345.17 347.12,344.61C347.68,342.77 348.23,340.93 348.8,339.1Z"/>
<path android:fillColor="#000000" android:pathData="M172.16,348.34C176.24,343.24 185.27,343.22 189.08,348.64C191.21,351.56 191.3,355.32 191.23,358.78C185.31,358.79 179.39,358.77 173.47,358.8C173.61,361.97 174.7,365.62 177.89,366.97C181.83,368.55 186.27,367.53 190.07,365.99C190.07,367.23 190.07,368.47 190.08,369.71C185.97,371.45 181.24,371.98 176.94,370.69C172.97,369.5 170.12,365.82 169.46,361.8C168.7,357.23 169.13,352.06 172.16,348.34M175.43,350.35C174.24,351.77 173.94,353.65 173.55,355.4C177.99,355.41 182.42,355.41 186.85,355.4C186.63,352.92 186.03,349.98 183.62,348.71C180.94,347.46 177.28,347.9 175.43,350.35Z"/>
<path android:fillColor="#000000" android:pathData="M197.72,345.03C198.87,345.02 200.03,345.03 201.18,345.03C201.35,346.65 201.52,348.27 201.67,349.89C203.04,348 204.54,346.04 206.77,345.13C208.69,344.31 210.81,344.59 212.82,344.78C212.64,346.08 212.47,347.39 212.29,348.7C210.46,348.48 208.51,348.16 206.77,348.98C203.81,350.23 202.02,353.42 201.99,356.57C201.91,361.34 201.99,366.12 201.96,370.9C200.54,370.9 199.13,370.89 197.71,370.9C197.71,362.27 197.71,353.65 197.72,345.03Z"/>
<path android:fillColor="#000000" android:pathData="M217.7,345.03C219.12,345.03 220.53,345.03 221.95,345.03C221.95,353.66 221.95,362.27 221.95,370.9C220.54,370.89 219.11,370.89 217.7,370.9C217.71,362.27 217.7,353.66 217.7,345.03Z"/>
<path android:fillColor="#000000" android:pathData="M231.01,346.79C235.38,344.69 240.7,343.7 245.29,345.67C248.06,346.9 249.08,350.08 249.08,352.89C249.15,358.89 249.08,364.89 249.11,370.89C248.08,370.89 247.05,370.89 246.02,370.9C245.74,369.64 245.46,368.38 245.19,367.13C243.66,368.76 242,370.5 239.74,371C236.27,371.81 231.98,371.51 229.58,368.55C227.33,365.32 227.67,360.06 231.16,357.8C235.23,355.14 240.35,355.56 245,355.31C244.91,353.03 245.14,350.02 242.8,348.76C239.4,347.11 235.52,348.58 232.31,349.99C231.87,348.92 231.44,347.86 231.01,346.79M234.89,359.66C232.06,361.07 231.59,365.95 234.61,367.4C237.63,368.63 241.58,367.77 243.62,365.15C245.1,363.18 244.87,360.58 244.94,358.26C241.58,358.47 237.99,358.13 234.89,359.66Z"/>
<path android:fillColor="#000000" android:pathData="M297.8,348.51C301.77,343.33 310.76,343.15 314.7,348.44C316.96,351.37 317.09,355.23 317.01,358.78C311.09,358.78 305.18,358.78 299.26,358.78C299.39,361.89 300.41,365.45 303.46,366.88C307.42,368.63 311.98,367.52 315.84,366.01C315.84,367.24 315.84,368.48 315.84,369.72C311.6,371.48 306.69,372.04 302.28,370.53C298.48,369.22 295.83,365.6 295.21,361.7C294.5,357.22 294.92,352.19 297.8,348.51M303.21,348.7C300.67,349.92 299.73,352.82 299.33,355.4C303.76,355.41 308.19,355.41 312.63,355.4C312.38,353.15 311.98,350.63 310.07,349.14C308.12,347.74 305.35,347.75 303.21,348.7Z"/>
<path android:fillColor="#000000" android:pathData="M324.87,346.25C329.48,343.59 335.23,344.42 339.97,346.26C339.49,347.38 339,348.51 338.52,349.64C335.18,348.4 331.35,347.29 327.87,348.65C325.82,349.31 325.46,352.29 327.21,353.48C330.67,355.9 335.18,356.34 338.46,359.07C341.83,361.94 340.88,368.16 336.84,369.94C332.24,372.12 326.67,371.75 322.05,369.78C322.05,368.49 322.05,367.2 322.06,365.92C325.8,367.56 330.13,368.72 334.14,367.35C336.44,366.62 337.2,363.27 335.25,361.75C331.86,359.19 327.3,358.74 324.01,356.01C320.99,353.56 321.42,348.11 324.87,346.25Z"/>
</vector>
5 changes: 5 additions & 0 deletions src/android/res/drawable/icon_monochrome.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:height="108dp" android:viewportHeight="500"
android:viewportWidth="500" android:width="108dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#38b6ff" android:pathData="M283.9,155C294.27,153.84 304.89,156.15 314.11,160.96C324.69,166.72 333.05,176.42 337.21,187.73C341.22,198.57 341.57,210.81 337.81,221.77C335.84,227.87 332.53,233.47 328.45,238.39C324.61,242.58 320.52,246.54 316.53,250.58C314.4,252.84 311.3,254.12 308.18,253.78C302.56,253.6 298.16,247.81 298.91,242.35C299.19,239.97 300.47,237.84 302.13,236.17C304.82,233.45 307.58,230.78 310.28,228.08C315.43,223.07 319.05,216.35 319.83,209.16C321.03,198.99 316.91,188.22 308.88,181.78C300.13,174.36 287.03,172.55 276.65,177.48C272.26,179.27 268.71,182.48 265.48,185.86C256.52,194.88 247.53,203.88 238.59,212.91C234.29,217.31 231.19,222.92 230.13,229C228.92,236.05 230.17,243.54 233.8,249.72C236.79,254.81 241.39,258.6 245.45,262.79C247.87,265.36 251.01,267.6 251.97,271.17C253.14,274.92 251.56,279.06 248.75,281.65C244.96,285.06 238.54,284.8 235.01,281.13C230.78,276.93 226.59,272.67 222.43,268.4C208.01,252.76 205.37,227.73 216.09,209.38C220.33,201.56 227.21,195.77 233.37,189.53C240.59,182.44 247.72,175.26 254.99,168.23C262.76,160.66 273.25,156.41 283.9,155Z"/>
<path android:fillColor="#38b6ff" android:pathData="M255.88,215.33C258.67,214.54 261.75,215.24 264.1,216.88C265.9,218.3 267.44,220.02 269.11,221.59C273.57,226.04 278.43,230.2 281.99,235.46C287.29,242.97 290.43,251.95 291.03,261.12C292.27,276.41 286.03,292.04 274.64,302.31C265.2,311.51 255.78,320.72 246.3,329.89C238.43,337.42 228.22,342.5 217.38,343.86C205.28,345.5 192.54,342.58 182.44,335.67C169.85,327.44 161.43,313.21 160.1,298.24C160.07,293.23 159.68,288.13 160.83,283.2C162.14,277.04 164.46,271.06 167.96,265.8C172.36,259.08 178.44,253.72 184.02,248.01C187.75,244.26 194.25,244.16 198.11,247.76C202.03,251.24 202.52,257.82 198.98,261.73C195.88,265.12 192.47,268.22 189.27,271.5C183.08,277.54 179.54,286.26 180.03,294.92C180.39,304.41 185.49,313.57 193.41,318.82C202.98,325.71 216.64,326.12 226.64,319.92C229.16,318.4 231.45,316.53 233.54,314.46C242.42,305.59 251.32,296.72 260.21,287.86C263.79,284.33 267.02,280.27 268.77,275.51C271.84,267.72 271.28,258.67 267.54,251.22C264.52,245 259.03,240.61 254.38,235.68C252.17,233.36 249.42,231.24 248.53,228.02C246.81,222.72 250.52,216.58 255.88,215.33Z"/>
</vector>
6 changes: 6 additions & 0 deletions src/android/res/mipmap-anydpi-v26/icon.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@android:color/white"/>
<foreground android:drawable="@drawable/icon_foreground"/>
<monochrome android:drawable="@drawable/icon_monochrome"/>
</adaptive-icon>
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
10 changes: 10 additions & 0 deletions src/icon/raw/SerialTest-nobg-notext-scaled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit da9f2ca

Please sign in to comment.