Skip to content

Commit

Permalink
change icon and add adaptive icon
Browse files Browse the repository at this point in the history
This also fixes the scaling of the maskable web icons.
  • Loading branch information
mwageringel committed Jul 22, 2022
1 parent 02c4597 commit b527479
Show file tree
Hide file tree
Showing 6 changed files with 158 additions and 33 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
*.ico
*.apk
*.apk.sha1
/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
/android/app/src/main/res/values/colors.xml

# Miscellaneous
*.class
Expand Down
16 changes: 12 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,31 @@ assets-web: fonts icons-web
icons-android: android/app/src/main/res/mipmap-hdpi/ic_launcher.png
assets/launcher_icon.png: assets/launcher_icon.svg
rsvg-convert --width=1024 --height=1024 --keep-aspect-ratio assets/launcher_icon.svg > $@
android/app/src/main/res/mipmap-hdpi/ic_launcher.png: assets/launcher_icon.png
assets/launcher_icon_adaptive.png: assets/launcher_icon_adaptive.svg
rsvg-convert --page-width=1024 --page-height=1024 --width=584 --height=584 --top=220 --left=220 --keep-aspect-ratio assets/launcher_icon_adaptive.svg > $@
android/app/src/main/res/mipmap-hdpi/ic_launcher.png: assets/launcher_icon.png assets/launcher_icon_adaptive.png
$(FLUTTER) pub get
$(FLUTTER) pub run flutter_launcher_icons:main

icons-web: website/favicon.ico web/favicon.ico web/icons/Icon-192.png web/icons/Icon-maskable-192.png web/icons/Icon-512.png web/icons/Icon-maskable-512.png
web/favicon.ico website/favicon.ico: assets/launcher_icon.svg
magick -background none assets/launcher_icon.svg -define icon:auto-resize $@
web/icons/Icon-192.png web/icons/Icon-maskable-192.png: assets/launcher_icon.svg
web/icons/Icon-192.png: assets/launcher_icon.svg
mkdir -p web/icons/
rsvg-convert --width=192 --height=192 --keep-aspect-ratio assets/launcher_icon.svg > $@
web/icons/Icon-512.png web/icons/Icon-maskable-512.png: assets/launcher_icon.svg
web/icons/Icon-512.png: assets/launcher_icon.svg
mkdir -p web/icons/
rsvg-convert --width=512 --height=512 --keep-aspect-ratio assets/launcher_icon.svg > $@
web/icons/Icon-maskable-192.png: assets/launcher_icon_adaptive.svg
mkdir -p web/icons/
rsvg-convert --page-width=192 --page-height=192 --width=150 --height=150 --top=21 --left=21 --keep-aspect-ratio -b '#536dfeff' assets/launcher_icon_adaptive.svg > $@
web/icons/Icon-maskable-512.png: assets/launcher_icon_adaptive.svg
mkdir -p web/icons/
rsvg-convert --page-width=512 --page-height=512 --width=400 --height=400 --top=56 --left=56 --keep-aspect-ratio -b '#536dfeff' assets/launcher_icon_adaptive.svg > $@
icons-clean:
rm -f android/app/src/main/res/mipmap-*/ic_launcher.png
rm -f website/favicon.ico web/favicon.ico web/icons/*.png
rm -f assets/launcher_icon.png
rm -f assets/launcher_icon.png assets/launcher_icon_adaptive.png

# fonts are downloaded and bundled into the app
fonts: fonts/NotoSansMath-Regular.ttf
Expand Down
75 changes: 48 additions & 27 deletions assets/launcher_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
92 changes: 92 additions & 0 deletions assets/launcher_icon_adaptive.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,5 @@ flutter_icons:
android: true
ios: false
image_path: assets/launcher_icon.png
adaptive_icon_foreground: assets/launcher_icon_adaptive.png
adaptive_icon_background: "#536dfe"
4 changes: 2 additions & 2 deletions web/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"short_name": "everest",
"start_url": ".",
"display": "standalone",
"background_color": "#0175C2",
"theme_color": "#0175C2",
"background_color": "#536dfe",
"theme_color": "#536dfe",
"description": "A mathematical puzzle game.",
"orientation": "portrait-primary",
"prefer_related_applications": false,
Expand Down

0 comments on commit b527479

Please sign in to comment.