feat(branding): 更换应用图标与开屏资源

This commit is contained in:
Zhou Weidong committed 2026-11-02 14:44:23 +08:00
1 parent 731638b31b
commit 613147c20c
62 files changed
+17 -73

No files matched your search

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

@@ -2,18 +2,6 @@
<!-- Author: fruit.com.cn --> <!-- Author: fruit.com.cn -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/splash_background" /> <item android:drawable="@color/splash_background" />
<item>
<shape android:shape="rectangle">
<gradient
android:type="radial"
android:centerX="0"
android:centerY="0"
android:gradientRadius="350dp"
android:startColor="#FF6B011A"
android:centerColor="#616B011A"
android:endColor="#006B011A" />
</shape>
</item>
<item> <item>
<bitmap <bitmap
android:gravity="center" android:gravity="center"
@@ -2,18 +2,6 @@
<!-- Author: fruit.com.cn --> <!-- Author: fruit.com.cn -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/splash_background" /> <item android:drawable="@color/splash_background" />
<item>
<shape android:shape="rectangle">
<gradient
android:type="radial"
android:centerX="0"
android:centerY="0"
android:gradientRadius="350dp"
android:startColor="#FF6B011A"
android:centerColor="#616B011A"
android:endColor="#006B011A" />
</shape>
</item>
<item> <item>
<bitmap <bitmap
android:gravity="center" android:gravity="center"
@@ -2,18 +2,6 @@
<!-- Author: fruit.com.cn --> <!-- Author: fruit.com.cn -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/splash_background" /> <item android:drawable="@color/splash_background" />
<item>
<shape android:shape="rectangle">
<gradient
android:type="radial"
android:centerX="0"
android:centerY="0"
android:gradientRadius="350dp"
android:startColor="#FF6B011A"
android:centerColor="#616B011A"
android:endColor="#006B011A" />
</shape>
</item>
<item> <item>
<bitmap <bitmap
android:gravity="center" android:gravity="center"
@@ -2,18 +2,6 @@
<!-- Author: fruit.com.cn --> <!-- Author: fruit.com.cn -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/splash_background" /> <item android:drawable="@color/splash_background" />
<item>
<shape android:shape="rectangle">
<gradient
android:type="radial"
android:centerX="0"
android:centerY="0"
android:gradientRadius="350dp"
android:startColor="#FF6B011A"
android:centerColor="#616B011A"
android:endColor="#006B011A" />
</shape>
</item>
<item> <item>
<bitmap <bitmap
android:gravity="center" android:gravity="center"
Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 KiB

After

Width:  |  Height:  |  Size: 12 KiB

@@ -2,18 +2,6 @@
<!-- Author: fruit.com.cn --> <!-- Author: fruit.com.cn -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/splash_background" /> <item android:drawable="@color/splash_background" />
<item>
<shape android:shape="rectangle">
<gradient
android:type="radial"
android:centerX="0"
android:centerY="0"
android:gradientRadius="350dp"
android:startColor="#FF6B011A"
android:centerColor="#616B011A"
android:endColor="#006B011A" />
</shape>
</item>
<item> <item>
<bitmap <bitmap
android:gravity="center" android:gravity="center"
Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 325 B

After

Width:  |  Height:  |  Size: 156 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 218 B

After

Width:  |  Height:  |  Size: 113 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 469 B

After

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 762 B

After

Width:  |  Height:  |  Size: 384 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 623 B

+2 -2
View File
@@ -3,5 +3,5 @@
<resources> <resources>
<color name="splash_background">#000000</color> <color name="splash_background">#000000</color>
<color name="ic_launcher_background">#E9142E</color> <color name="ic_launcher_background">#000000</color>
</resources> </resources>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 734 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 734 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 822 B

After

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 799 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 587 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 799 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 109 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 364 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 655 KiB

After

Width:  |  Height:  |  Size: 20 KiB

+2 -2
View File
@@ -146,12 +146,12 @@ flutter_launcher_icons:
android: true android: true
ios: true ios: true
image_path: assets/icon/ymb.png image_path: assets/icon/ymb.png
adaptive_icon_background: "#E9142E" adaptive_icon_background: "#000000"
adaptive_icon_foreground: assets/icon/ymb_foreground.png adaptive_icon_foreground: assets/icon/ymb_foreground.png
remove_alpha_ios: true remove_alpha_ios: true
# 开屏页资源目前是手工维护的:Android 走 res/drawable*/launch_background.xml # 开屏页资源目前是手工维护的:Android 走 res/drawable*/launch_background.xml
# (黑底暗红渐变 + 居中标识),iOS 走 LaunchImage.imageset 的完整参考图。 # (黑底白字标居中),iOS 走 LaunchImage.imageset 的完整参考图。
# 不要再执行 `dart run flutter_native_splash:create`,它只会按 color 重新生成, # 不要再执行 `dart run flutter_native_splash:create`,它只会按 color 重新生成,
# 会覆盖固定尺寸布局。使用 python3 tools/generate_brand_assets.py 生成资源。 # 会覆盖固定尺寸布局。使用 python3 tools/generate_brand_assets.py 生成资源。
flutter_native_splash: flutter_native_splash:
+6 -5
View File
@@ -14,7 +14,7 @@ const _launchWidth = 390;
const _launchHeight = 844; const _launchHeight = 844;
const _androidRoot = 'android/app/src/main/res'; const _androidRoot = 'android/app/src/main/res';
const _iosRoot = 'ios/Runner/Assets.xcassets'; const _iosRoot = 'ios/Runner/Assets.xcassets';
const _red = [245, 48, 59, 255]; const _ink = [0, 0, 0, 255];
void main() { void main() {
TestWidgetsFlutterBinding.ensureInitialized(); TestWidgetsFlutterBinding.ensureInitialized();
@@ -32,9 +32,9 @@ void main() {
expect(image.width, _iconSize); expect(image.width, _iconSize);
expect(image.height, _iconSize); expect(image.height, _iconSize);
final bytes = await image.toByteData(); final bytes = await image.toByteData();
final pixel = bytes!.buffer.asUint8List().sublist(0, _red.length); final pixel = bytes!.buffer.asUint8List().sublist(0, _ink.length);
for (var channel = 0; channel < _red.length; channel++) { for (var channel = 0; channel < _ink.length; channel++) {
expect(pixel[channel], closeTo(_red[channel], 2)); expect(pixel[channel], closeTo(_ink[channel], 2));
} }
}); });
@@ -84,7 +84,8 @@ void main() {
final layers = File( final layers = File(
'$_androidRoot/drawable$qualifier/launch_background.xml', '$_androidRoot/drawable$qualifier/launch_background.xml',
).readAsStringSync(); ).readAsStringSync();
expect(layers, contains('<gradient')); expect(layers, contains('@color/splash_background'));
expect(layers, isNot(contains('<gradient')));
expect(layers, contains('android:gravity="center"')); expect(layers, contains('android:gravity="center"'));
expect(layers, contains('@drawable/splash_screen')); expect(layers, contains('@drawable/splash_screen'));
} }
+7 -4
View File
@@ -12,7 +12,7 @@ IOS = ROOT / "ios/Runner/Assets.xcassets"
ANDROID = ROOT / "android/app/src/main/res" ANDROID = ROOT / "android/app/src/main/res"
REFERENCE = ROOT / "assets/branding/ymb-reference.png" REFERENCE = ROOT / "assets/branding/ymb-reference.png"
LAUNCH_REFERENCE = ROOT / "assets/branding/ymb-launch-reference.png" LAUNCH_REFERENCE = ROOT / "assets/branding/ymb-launch-reference.png"
BRAND_RED = "#E9142E" BRAND_BACKGROUND = "#000000"
WHITE = "#FFFFFF" WHITE = "#FFFFFF"
CLEAR = (0, 0, 0, 0) CLEAR = (0, 0, 0, 0)
MASTER_SIZE = 1024 MASTER_SIZE = 1024
@@ -104,7 +104,7 @@ def android_assets(master, foreground):
ANDROID / f"drawable-{density}/ic_launcher_foreground.png", ANDROID / f"drawable-{density}/ic_launcher_foreground.png",
) )
save( save(
Image.new("RGB", (pixels, pixels), BRAND_RED), Image.new("RGB", (pixels, pixels), BRAND_BACKGROUND),
ANDROID / f"mipmap-{density}/ic_launcher_background.png", ANDROID / f"mipmap-{density}/ic_launcher_background.png",
) )
mark = splash_icon(master, round(SPLASH_SIZE * scale)) mark = splash_icon(master, round(SPLASH_SIZE * scale))
@@ -117,10 +117,13 @@ def android_assets(master, foreground):
def main(): def main():
"""直接复用确认的原始图标和开屏,输出平台所需尺寸。""" """直接复用确认的原始图标和开屏,输出平台所需尺寸。"""
reference = Image.open(REFERENCE).convert("RGB") reference = Image.open(REFERENCE).convert("RGB")
master = reference.resize((MASTER_SIZE, MASTER_SIZE), RESAMPLE)
mark = wordmark(reference) mark = wordmark(reference)
master = centered(
Image.new("RGBA", (MASTER_SIZE, MASTER_SIZE), (0, 0, 0, 255)),
mark.resize((MASTER_SIZE, MASTER_SIZE), RESAMPLE),
)
foreground = mark.resize((MASTER_SIZE, MASTER_SIZE), RESAMPLE) foreground = mark.resize((MASTER_SIZE, MASTER_SIZE), RESAMPLE)
save(master, ASSETS / "ymb.png") save(master.convert("RGB"), ASSETS / "ymb.png")
save(foreground, ASSETS / "ymb_foreground.png") save(foreground, ASSETS / "ymb_foreground.png")
placeholder = centered( placeholder = centered(
Image.new("RGBA", PLACEHOLDER_SIZE, CLEAR), Image.new("RGBA", PLACEHOLDER_SIZE, CLEAR),