SchildiChat-android/legacy_icons.sh
SpiritCroc 23bf6b9ffa Theme legacy icons as well
We want to prefer the SC accent/design to the Element one on devvices
pre-API-24 as well.

Closes SpiritCroc/SchildiChat-android#4.
2020-08-12 13:35:31 +02:00

23 lines
581 B
Bash
Executable File

#!/bin/bash
set -e
# Generate legacy icons for custom color icons in drawable-anydpi-v24
pushd "$(dirname "$(realpath "$0")")" > /dev/null
desired_accent=`cat vector/src/main/res/values/colors_sc.xml | grep '<color name="accent_sc">' | sed 's|.*>\(.*\)</.*|\1|'`
echo "Hardcode colorAccent to $desired_accent"
for f in vector/src/main/res/drawable-anydpi-v24/*; do
target_file="vector/src/main/res/drawable/$(basename "$f")"
echo "$f -> $target_file"
sed "s|?\(android:\)\?\(attr/\)\?colorAccent|$desired_accent|g" "$f" > "$target_file"
done
popd > /dev/null