Ver código fonte

换掉默认的 Flutter 启动图标

原来是 flutter create 生成的默认图标。新图标用靛蓝渐变圆角方块 + 白色
积分号 ∫ —— 选 ∫ 是因为符号计算正是这个 App 和普通计算器的区别所在。

同时补上了 Android 8+ 的**自适应图标**(Flutter 默认模板只给传统 PNG,
没有 mipmap-anydpi-v26),背景用 drawable 渐变,前景层留足了 108dp 画布
的裁切安全区,被裁成圆形/方形都不会切到字形。

图标由 /tmp/gen_icon.py 用 PIL 生成(脚本没进仓库,位置记在这里)。
如果以后要换字形,改那个脚本里的 glyph 重跑即可。

Co-Authored-By: Claude Code <noreply@anthropic.com>
nonvioce 4 semanas atrás
pai
commit
8439874bae

+ 9 - 0
android/app/src/main/res/drawable/ic_launcher_background.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <gradient
+        android:angle="270"
+        android:startColor="#5C6BC0"
+        android:endColor="#3949AB"
+        android:type="linear"/>
+</shape>

+ 5 - 0
android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml

@@ -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="@drawable/ic_launcher_background"/>
+    <foreground android:drawable="@mipmap/ic_launcher_foreground"/>
+</adaptive-icon>

+ 5 - 0
android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml

@@ -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="@drawable/ic_launcher_background"/>
+    <foreground android:drawable="@mipmap/ic_launcher_foreground"/>
+</adaptive-icon>

BIN
android/app/src/main/res/mipmap-hdpi/ic_launcher.png


BIN
android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png


BIN
android/app/src/main/res/mipmap-mdpi/ic_launcher.png


BIN
android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png


BIN
android/app/src/main/res/mipmap-xhdpi/ic_launcher.png


BIN
android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png


BIN
android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png


BIN
android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png


BIN
android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png


BIN
android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png