Skip to content

Commit

Permalink
feat: add android adaptive icon (#180)
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-the-shark authored Sep 2, 2024
1 parent f602712 commit 31b2f2f
Show file tree
Hide file tree
Showing 23 changed files with 67 additions and 2 deletions.
2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<application
android:label="ToPwr"
android:name="${applicationName}"
android:icon="@mipmap/launcher_icon">
android:icon="@mipmap/ic_launcher">
<meta-data android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyDKfUDQv4mb4W4I4bx0WE4qYkAl53Vfciw" />
<activity
Expand Down
Binary file added android/app/src/main/ic_launcher-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions android/app/src/main/res/drawable/ic_launcher_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<gradient
android:type="radial"
android:centerX="50%"
android:centerY="50%"
android:gradientRadius="50%"
android:startColor="#F26D43"
android:endColor="#DE371B"
android:centerColor="#FFEE6645"
android:useLevel="false" />
</shape>
</item>

</selector>
36 changes: 36 additions & 0 deletions android/app/src/main/res/drawable/ic_launcher_foreground.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="904"
android:viewportHeight="232">
<group android:scaleX="0.69"
android:scaleY="0.69"
android:translateX="140.12"
android:translateY="35.96">
<group android:scaleX="0.67346936"
android:scaleY="0.17283727"
android:translateX="147.59184"
android:translateY="95.950874">
<path
android:pathData="m60.5,11.5q71.1,-0.7 142,1.5 17.4,11.8 7.5,30.5 -3.3,3.8 -7.5,6.5 -37.9,2.2 -76,1.5 0.3,76.5 -0.5,153 -7.9,19.8 -28.5,13.5 -9.2,-5.1 -11.5,-15.5 -0.8,-75.5 -0.5,-151 -13,0.2 -26,-0.5 -17.9,-8.4 -12.5,-27.5 4.2,-9 13.5,-12z"
android:fillColor="#fefffe"
android:fillType="evenOdd"/>
<path
android:pathData="m317.5,11.5q48.5,-0.7 97,1.5 49.9,16 45.5,68.5 -7.4,33.9 -39.5,46.5 -18.2,4.4 -37,3.5 0.3,35.5 -0.5,71 -8.3,23.3 -31.5,13.5 -6.6,-4.6 -8.5,-12.5 -0.3,-36 -1.5,-72 -24.4,-4.8 -18.5,-29 6.1,-11.8 19.5,-12 0,-19 0,-38 -12.5,0.2 -25,-0.5 -15.4,-4 -17,-20 1.8,-16 17,-20.5zM383.5,90.5q11.5,0.2 23,-0.5 7.8,-1.5 11.5,-8.5 8.4,-17.6 -8.5,-27.5 -12.9,-2.1 -26,-1.5 0,19 0,38z"
android:fillColor="#fefffe"
android:fillType="evenOdd"/>
<path
android:pathData="m497.5,11.5q18,-0.3 22.5,17 0.5,69 1,138 6.9,16.8 24.5,12.5 9.9,-4.1 12.5,-14.5 0.5,-52 1,-104 4.6,-14.2 19.5,-15 17.7,1.5 20.5,19 0,52.6 2,105 8.2,13.2 23.5,9.5 10.3,-4.4 12.5,-15.5 0.5,-68.5 1,-137 8.2,-18.2 27.5,-12.5 8.3,3.8 11.5,12.5 1,72.5 0,145 -12.1,45.1 -59,49 -22.3,-1.2 -39.5,-15 -38,28.5 -77,1.5 -17.8,-15.3 -21.5,-38.5 -1,-70.5 0,-141 4.3,-13.1 17.5,-16z"
android:fillColor="#fefffe"
android:fillType="evenOdd"/>
<path
android:pathData="m713.5,11.5q48,-0.7 96,1.5 44.3,12.5 47,58.5 -0.5,21.7 -14,38.5 12.5,14.4 14.5,33.5 1,30 0,60 -7,20.9 -28.5,14.5 -9.5,-4.3 -11.5,-14.5 -0.5,-29.5 -1,-59 -3.3,-9.3 -12.5,-12.5 -12.5,-0.7 -25,-0.5 0.7,37.6 -1.5,75 -8,15.8 -25.5,11.5 -11,-4 -13.5,-15.5 -0.3,-35.5 -1.5,-71 -22.6,-4.2 -18.5,-27 4.9,-13.7 19.5,-14 0,-19 0,-38 -12.5,0.2 -25,-0.5 -19.7,-7.1 -14.5,-27.5 4.9,-10.2 15.5,-13zM778.5,90.5q11,0.2 22,-0.5 9.5,-2.5 13.5,-11.5 5.3,-18.3 -12.5,-25.5 -11.5,-0.7 -23,-0.5 0,19 0,38z"
android:fillColor="#fefffe"
android:fillType="evenOdd"/>
<path
android:pathData="m207.5,100.5q46.2,-3.6 65.5,38 13.8,46.2 -25.5,73.5 -43.2,20.5 -76.5,-13.5 -25.2,-35.5 -3,-73 15,-20.2 39.5,-25zM199,154.5q-3.1,21.3 18,25 18.2,-1.9 19.5,-20 -3,-18.5 -22,-19 -11.2,2.9 -15.5,14z"
android:fillColor="#fefffe"
android:fillType="evenOdd"/>
</group>
</group>
</vector>
6 changes: 6 additions & 0 deletions android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.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="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>
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="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>
Binary file removed android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ flutter_native_splash:
image: assets/splash_screen/splash_logo.png

flutter_launcher_icons:
android: "launcher_icon"
android: false # manually set in Android Studio
ios: true
remove_alpha_ios: true
image_path: "assets/app_icon.png"
Expand Down

0 comments on commit 31b2f2f

Please sign in to comment.