Ship one copy of each launcher icon

The round launcher icons were byte-identical copies of the square ones in
every density. They are now resource aliases of them, and the unused
mipmap copies of the adaptive foregrounds are gone, so the APK carries
about 170 KB less. generate-icons.sh writes only the square icons.
This commit is contained in:
waozi committed 2026-10-29 13:26:38 -03:00
1 parent 6ae3f5853d
commit 306e25e79a
18 files changed
+9 -16

No files matched your search

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

@@ -1,5 +0,0 @@
<?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="@drawable/ic_launcher_air_foreground" />
</adaptive-icon>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

@@ -1,5 +0,0 @@
<?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="@drawable/ic_launcher_foreground" />
</adaptive-icon>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Round launcher icons are the same pictures as the square ones. -->
<item name="ic_launcher_round" type="mipmap">@mipmap/ic_launcher</item>
<item name="ic_launcher_air_round" type="mipmap">@mipmap/ic_launcher_air</item>
</resources>
+3 -6
View File
@@ -112,20 +112,17 @@ for variant in sky air; do
density=${density_size%:*}
size=${density_size#*:}
generate_transparent "$size" "$PROJECT_ROOT/droid/app/src/main/res/mipmap-$density/$name.png"
generate_transparent "$size" "$PROJECT_ROOT/droid/app/src/main/res/mipmap-$density/${name}_round.png"
done
generate_transparent 432 "$PROJECT_ROOT/droid/app/src/main/res/drawable/${name}_foreground.png" 240
generate_transparent 108 "$PROJECT_ROOT/droid/app/src/main/res/mipmap-anydpi-v26/${name}_foreground.png" 60
generate_transparent 108 "$PROJECT_ROOT/droid/app/src/main/res/mipmap-anydpi-v26/${name}_round_foreground.png" 60
for suffix in "" _round; do
cat > "$PROJECT_ROOT/droid/app/src/main/res/mipmap-anydpi-v26/${name}${suffix}.xml" <<EOF
# Round icons are the same pictures: res/values/launcher_round.xml names
# them as aliases of these, so the APK carries one copy.
cat > "$PROJECT_ROOT/droid/app/src/main/res/mipmap-anydpi-v26/${name}.xml" <<EOF
<?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="@drawable/${name}_foreground" />
</adaptive-icon>
EOF
done
# Settings previews contain only the person and cloud.
generate_transparent 192 "$PROJECT_ROOT/assets/app/icon-$preview.png"
done