Commit ab4b3e18 authored by Roumen Petrov's avatar Roumen Petrov

adaptive launcher icons

parent 4c25f81a
#! /bin/sh
set -e
cd `dirname $0`
XCFFILE=../docs/termoneplus-launcher-icon.xcf
for MODE in l m h xh xxh xxxh ; do
case "$MODE" in
l) dpi=120; continue;; # unused
m) dpi=160;;
h) dpi=240;;
xh) dpi=320;;
xxh) dpi=480;;
xxxh) dpi=640;;
*) dpi=160;;
esac
# launcher icon size = 32 dp * ( dpi / 160 ) * 1.5
size=`expr $dpi \* 3 / 10`
xsize=`expr $dpi / 2`
off=`expr \( $xsize - $size \) / 2`
qualifier=
test -z "$MODE" || qualifier=-"$MODE"dpi
PNGFILE=mipmap"$qualifier"/ic_launcher_foreground.png
echo creating .../$PNGFILE ... >&2
# Start gimp with python-fu batch-interpreter
gimp -i --batch-interpreter=python-fu-eval -b - << EOF
import gimpfu
def convert(xcf_file, png_file):
img = pdb.gimp_file_load(xcf_file, xcf_file)
layer = pdb.gimp_image_merge_visible_layers(img, 1)
#pdb.gimp_image_convert_indexed(img, NO_DITHER, MAKE_PALETTE, 255, False, True, '');
pdb.gimp_image_scale(img, $size, $size);
pdb.gimp_image_resize(img, $xsize, $xsize, $off, $off)
pdb.gimp_layer_resize (layer, $xsize, $xsize, $off, $off)
pdb.gimp_file_save(img, layer, png_file, png_file)
pdb.gimp_image_delete(img)
convert('$XCFFILE', '../term/src/main/res/$PNGFILE')
pdb.gimp_quit(1)
EOF
done
......@@ -39,17 +39,17 @@ for MODE in l m h xh xxh xxxh ; do
gimp -i --batch-interpreter=python-fu-eval -b - << EOF
import gimpfu
def convert(xcf_file, new_size, png_file):
def convert(xcf_file, png_file):
img = pdb.gimp_file_load(xcf_file, xcf_file)
layer = pdb.gimp_image_merge_visible_layers(img, 1)
#pdb.gimp_image_convert_indexed(img, NO_DITHER, MAKE_PALETTE, 255, False, True, '');
pdb.gimp_image_scale(img, new_size, new_size);
pdb.gimp_image_scale(img, $size, $size);
pdb.gimp_file_save(img, layer, png_file, png_file)
pdb.gimp_image_delete(img)
convert('${XCFFILE}', '${size}', '../term/src/main/res/${PNGFILE}')
convert('$XCFFILE', '../term/src/main/res/$PNGFILE')
pdb.gimp_quit(1)
EOF
......
<?xml version="1.0" encoding="utf-8"?>
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#D1DADE"
android:pathData="M0,0h108v108h-108z"/>
</vector>
<?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>
<?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>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment