populate app icons in different resolutions
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Wed, 30 Jan 2019 19:46:16 +0000 (19:46 +0000)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Wed, 30 Jan 2019 19:46:16 +0000 (19:46 +0000)
app/src/main/res/drawable-hdpi/ic_app_icon.png [new file with mode: 0644]
app/src/main/res/drawable-ldpi/ic_app_icon.png [new file with mode: 0644]
app/src/main/res/drawable-mdpi/ic_app_icon.png [new file with mode: 0644]
app/src/main/res/drawable-tvdpi/ic_app_icon.png [new file with mode: 0644]
app/src/main/res/drawable-xhdpi/ic_app_icon.png [new file with mode: 0644]
app/src/main/res/drawable-xxhdpi/ic_app_icon.png [new file with mode: 0644]
app/src/main/res/drawable-xxxhdpi/ic_app_icon.png [new file with mode: 0644]
tools/populate-app-icon [new file with mode: 0755]

diff --git a/app/src/main/res/drawable-hdpi/ic_app_icon.png b/app/src/main/res/drawable-hdpi/ic_app_icon.png
new file mode 100644 (file)
index 0000000..673c179
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_app_icon.png differ
diff --git a/app/src/main/res/drawable-ldpi/ic_app_icon.png b/app/src/main/res/drawable-ldpi/ic_app_icon.png
new file mode 100644 (file)
index 0000000..bc65387
Binary files /dev/null and b/app/src/main/res/drawable-ldpi/ic_app_icon.png differ
diff --git a/app/src/main/res/drawable-mdpi/ic_app_icon.png b/app/src/main/res/drawable-mdpi/ic_app_icon.png
new file mode 100644 (file)
index 0000000..d4d5f64
Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_app_icon.png differ
diff --git a/app/src/main/res/drawable-tvdpi/ic_app_icon.png b/app/src/main/res/drawable-tvdpi/ic_app_icon.png
new file mode 100644 (file)
index 0000000..a14c0eb
Binary files /dev/null and b/app/src/main/res/drawable-tvdpi/ic_app_icon.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_app_icon.png b/app/src/main/res/drawable-xhdpi/ic_app_icon.png
new file mode 100644 (file)
index 0000000..1897ee3
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_app_icon.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_app_icon.png b/app/src/main/res/drawable-xxhdpi/ic_app_icon.png
new file mode 100644 (file)
index 0000000..c89edea
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_app_icon.png differ
diff --git a/app/src/main/res/drawable-xxxhdpi/ic_app_icon.png b/app/src/main/res/drawable-xxxhdpi/ic_app_icon.png
new file mode 100644 (file)
index 0000000..0c53b1c
Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_app_icon.png differ
diff --git a/tools/populate-app-icon b/tools/populate-app-icon
new file mode 100755 (executable)
index 0000000..06dc7a4
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+set -e
+set -u
+
+ROOT_DIR=$(dirname $(realpath "$0"))/..
+ART_DIR="$ROOT_DIR/art"
+RES_DIR="$ROOT_DIR/app/src/main/res"
+ICON_ART="$ART_DIR/app-icon.svg"
+
+gen_icons() {
+    while read size name; do
+        mkdir -p "$RES_DIR/drawable-$name"
+        convert "$ICON_ART" -scale ${size}x${size} \
+            -antialias -strip \
+            "$RES_DIR/drawable-$name/ic_app_icon.png"
+    done
+}
+
+cat <<EOF | gen_icons
+36 ldpi
+48 mdpi
+64 tvdpi
+72 hdpi
+96 xhdpi
+144 xxhdpi
+192 xxxhdpi
+EOF