Skip to content

Commit

Permalink
feat: add adaptive icon including monochrome
Browse files Browse the repository at this point in the history
  • Loading branch information
maelchiotti committed Apr 2, 2024
1 parent 186e4c2 commit 0c746a0
Show file tree
Hide file tree
Showing 27 changed files with 42 additions and 25 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 @@ -5,7 +5,7 @@
<application
android:label="Material Notes"
android:name="${applicationName}"
android:icon="@mipmap/launcher_icon">
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/ic_launcher_monochrome"/>
</adaptive-icon>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions android/app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#2278e9</color>
</resources>
Binary file removed assets/icons/icon_android_12.png
Binary file not shown.
Binary file added assets/icons/icon_foreground.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 assets/icons/icon_foreground.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/icon_foreground_monochrome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/icons/icon_full.png
Binary file not shown.
16 changes: 0 additions & 16 deletions assets/icons/icon_full.svg

This file was deleted.

9 changes: 6 additions & 3 deletions flutter_launcher_icons.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# dart run flutter_launcher_icons
flutter_launcher_icons:
image_path: "assets/logos/icon.png"
android: "launcher_icon"
min_sdk_android: 34
image_path: "assets/icons/icon.png"
adaptive_icon_foreground: "assets/icons/icon_foreground.png"
adaptive_icon_monochrome: "assets/icons/icon_foreground_monochrome.png"
adaptive_icon_background: "#2278e9"
android: true
min_sdk_android: 21
ios: false
9 changes: 5 additions & 4 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -361,10 +361,11 @@ packages:
flutter_launcher_icons:
dependency: "direct dev"
description:
name: flutter_launcher_icons
sha256: "526faf84284b86a4cb36d20a5e45147747b7563d921373d4ee0559c54fcdbcea"
url: "https://pub.dev"
source: hosted
path: "."
ref: HEAD
resolved-ref: "006cb1ed53f969bf11816cde5b16dd520e1ee40e"
url: "git@github.com:fluttercommunity/flutter_launcher_icons.git"
source: git
version: "0.13.1"
flutter_localizations:
dependency: "direct main"
Expand Down
4 changes: 3 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ dependencies:
dev_dependencies:
build_runner: ^2.4.8
custom_lint: ^0.5.11
flutter_launcher_icons: ^0.13.1
# TODO: replace when the monochrome feature is released on pub.dev
flutter_launcher_icons:
git: git@github.com:fluttercommunity/flutter_launcher_icons.git
flutter_test:
sdk: flutter
isar_generator: ^3.1.0+1
Expand Down

0 comments on commit 0c746a0

Please sign in to comment.