BobStore/F-Droid/tools/download-material-icon.sh
relan cc43561bf2 Reduce action bar icons size from 48dp to 24dp
From the Material Design spec:

> DP unit grid

> System icons are displayed at 24dp.

See http://www.google.com/design/spec/style/icons.html#icons-system-icons

Script used to update the icons:

    function download {
        F-Droid/tools/download-material-icon.sh F-Droid/res $1 $2
    }

    download content add
    download device bluetooth
    download action delete
    download notification do_not_disturb
    download image edit
    download action help
    download device nfc
    download av play_arrow
    download navigation refresh
    download action search
    download action settings
    download social share
    download action view_headline
2015-07-17 08:34:32 +03:00

75 lines
1.8 KiB
Bash
Executable File

#!/bin/bash
#
# Helper script to download icons from https://github.com/google/material-design-icons and
# put the in the relevant drawable-* directories.
#
function usage {
echo "USAGE: download-material-icon.sh res-directory category icon"
echo " res-directory Usually \"res\" in your android project"
echo " category the grouping seen in the URL below (e.g. action, alert, av, communication, content, etc)"
echo " icon is the name if the icon (see URL below for icons)"
echo ""
echo "To see available icons, visit http://google.github.io/material-design-icons/"
}
function download {
REMOTE_DRAWABLE_DIR=$1
LOCAL_DRAWABLE_DIR=$2
FILE="ic_${ICON}_24dp.png"
URL="$BASE_URL/$CATEGORY/$REMOTE_DRAWABLE_DIR/$FILE"
DIR="$RES_DIR/$LOCAL_DRAWABLE_DIR"
if [ ! -d $DIR ]
then
echo "Creating dir $DIR"
mkdir $DIR
fi
LOCAL_PATH="$DIR/ic_${ICON}.png"
echo "Downloading to $LOCAL_PATH"
wget --quiet --output-document=$LOCAL_PATH $URL
if [ ! -s $LOCAL_PATH ]
then
if [ -f $LOCAL_PATH ]
then
rm $LOCAL_PATH
fi
echo "ERROR: Could not download from $URL to $LOCAL_PATH failed."
echo ""
usage
exit
fi
}
RES_DIR=$1
CATEGORY=$2
ICON="${3}_white"
BASE_URL="https://raw.githubusercontent.com/google/material-design-icons/master"
SCREENS="mdpi hdpi xhdpi xxhdpi xxxhdpi"
if [ ! -d $RES_DIR ]
then
echo "ERROR: $RES_DIR is not a directory"
echo ""
usage
exit
fi
download drawable-mdpi drawable
for SCREEN in $SCREENS
do
download "drawable-$SCREEN" "drawable-$SCREEN"
done
echo ""
echo "Please make sure you have the following attribution (or words to this effect) somewhere in your project:"
echo ""
echo " Some icons are from the Material Design Icon set (https://github.com/google/material-design-icons)"
echo " released under an Attribution 4.0 International license (http://creativecommons.org/licenses/by/4.0/)"
echo ""