feat(branding): 更换应用图标与开屏资源
No files matched your search
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 2.4 KiB |
@@ -2,18 +2,6 @@
|
||||
<!-- Author: fruit.com.cn -->
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<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>
|
||||
<bitmap
|
||||
android:gravity="center"
|
||||
|
||||
@@ -2,18 +2,6 @@
|
||||
<!-- Author: fruit.com.cn -->
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<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>
|
||||
<bitmap
|
||||
android:gravity="center"
|
||||
|
||||
@@ -2,18 +2,6 @@
|
||||
<!-- Author: fruit.com.cn -->
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<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>
|
||||
<bitmap
|
||||
android:gravity="center"
|
||||
|
||||
@@ -2,18 +2,6 @@
|
||||
<!-- Author: fruit.com.cn -->
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<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>
|
||||
<bitmap
|
||||
android:gravity="center"
|
||||
|
||||
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 8.9 KiB After Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 107 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 8.0 KiB |
|
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 12 KiB |
@@ -2,18 +2,6 @@
|
||||
<!-- Author: fruit.com.cn -->
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<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>
|
||||
<bitmap
|
||||
android:gravity="center"
|
||||
|
||||
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 325 B After Width: | Height: | Size: 156 B |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 218 B After Width: | Height: | Size: 113 B |
|
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 469 B After Width: | Height: | Size: 216 B |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 762 B After Width: | Height: | Size: 384 B |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 623 B |
@@ -3,5 +3,5 @@
|
||||
|
||||
<resources>
|
||||
<color name="splash_background">#000000</color>
|
||||
<color name="ic_launcher_background">#E9142E</color>
|
||||
<color name="ic_launcher_background">#000000</color>
|
||||
</resources>
|
||||
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 734 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 107 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 734 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 822 B After Width: | Height: | Size: 361 B |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 799 B |
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 587 B |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 799 B |
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 109 KiB After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 364 KiB After Width: | Height: | Size: 9.9 KiB |
|
Before Width: | Height: | Size: 655 KiB After Width: | Height: | Size: 20 KiB |
@@ -146,12 +146,12 @@ flutter_launcher_icons:
|
||||
android: true
|
||||
ios: true
|
||||
image_path: assets/icon/ymb.png
|
||||
adaptive_icon_background: "#E9142E"
|
||||
adaptive_icon_background: "#000000"
|
||||
adaptive_icon_foreground: assets/icon/ymb_foreground.png
|
||||
remove_alpha_ios: true
|
||||
|
||||
# 开屏页资源目前是手工维护的:Android 走 res/drawable*/launch_background.xml
|
||||
# (黑底暗红渐变 + 居中标识),iOS 走 LaunchImage.imageset 的完整参考图。
|
||||
# (黑底白字标居中),iOS 走 LaunchImage.imageset 的完整参考图。
|
||||
# 不要再执行 `dart run flutter_native_splash:create`,它只会按 color 重新生成,
|
||||
# 会覆盖固定尺寸布局。使用 python3 tools/generate_brand_assets.py 生成资源。
|
||||
flutter_native_splash:
|
||||
|
||||
@@ -14,7 +14,7 @@ const _launchWidth = 390;
|
||||
const _launchHeight = 844;
|
||||
const _androidRoot = 'android/app/src/main/res';
|
||||
const _iosRoot = 'ios/Runner/Assets.xcassets';
|
||||
const _red = [245, 48, 59, 255];
|
||||
const _ink = [0, 0, 0, 255];
|
||||
|
||||
void main() {
|
||||
TestWidgetsFlutterBinding.ensureInitialized();
|
||||
@@ -32,9 +32,9 @@ void main() {
|
||||
expect(image.width, _iconSize);
|
||||
expect(image.height, _iconSize);
|
||||
final bytes = await image.toByteData();
|
||||
final pixel = bytes!.buffer.asUint8List().sublist(0, _red.length);
|
||||
for (var channel = 0; channel < _red.length; channel++) {
|
||||
expect(pixel[channel], closeTo(_red[channel], 2));
|
||||
final pixel = bytes!.buffer.asUint8List().sublist(0, _ink.length);
|
||||
for (var channel = 0; channel < _ink.length; channel++) {
|
||||
expect(pixel[channel], closeTo(_ink[channel], 2));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -84,7 +84,8 @@ void main() {
|
||||
final layers = File(
|
||||
'$_androidRoot/drawable$qualifier/launch_background.xml',
|
||||
).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('@drawable/splash_screen'));
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ IOS = ROOT / "ios/Runner/Assets.xcassets"
|
||||
ANDROID = ROOT / "android/app/src/main/res"
|
||||
REFERENCE = ROOT / "assets/branding/ymb-reference.png"
|
||||
LAUNCH_REFERENCE = ROOT / "assets/branding/ymb-launch-reference.png"
|
||||
BRAND_RED = "#E9142E"
|
||||
BRAND_BACKGROUND = "#000000"
|
||||
WHITE = "#FFFFFF"
|
||||
CLEAR = (0, 0, 0, 0)
|
||||
MASTER_SIZE = 1024
|
||||
@@ -104,7 +104,7 @@ def android_assets(master, foreground):
|
||||
ANDROID / f"drawable-{density}/ic_launcher_foreground.png",
|
||||
)
|
||||
save(
|
||||
Image.new("RGB", (pixels, pixels), BRAND_RED),
|
||||
Image.new("RGB", (pixels, pixels), BRAND_BACKGROUND),
|
||||
ANDROID / f"mipmap-{density}/ic_launcher_background.png",
|
||||
)
|
||||
mark = splash_icon(master, round(SPLASH_SIZE * scale))
|
||||
@@ -117,10 +117,13 @@ def android_assets(master, foreground):
|
||||
def main():
|
||||
"""直接复用确认的原始图标和开屏,输出平台所需尺寸。"""
|
||||
reference = Image.open(REFERENCE).convert("RGB")
|
||||
master = reference.resize((MASTER_SIZE, MASTER_SIZE), RESAMPLE)
|
||||
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)
|
||||
save(master, ASSETS / "ymb.png")
|
||||
save(master.convert("RGB"), ASSETS / "ymb.png")
|
||||
save(foreground, ASSETS / "ymb_foreground.png")
|
||||
placeholder = centered(
|
||||
Image.new("RGBA", PLACEHOLDER_SIZE, CLEAR),
|
||||
|
||||