Skip to content

Latest commit

 

History

History
140 lines (93 loc) · 3.25 KB

CONTRIBUTING.md

File metadata and controls

140 lines (93 loc) · 3.25 KB

CONTRIBUTING

Icon guideline

Basic

For Android icons, see here.

Size

Icon file will be created with 24dp, which means 24x24px for drawable-mdpi.

Width

Use 2dp width for lines and radius.

Colors

Use white(#ffffff) with 80% alpha.

Some rules to build

Icons are made with .svg files, and build script relies on some structures or naming conventions.
So if you want to add or edit .svg files, check this section.

File

Format

Must be svg.

Naming

For Android action bar icons, it should start with ic_action_.

Layers

Naming

Icon file has two layers: background and icon.
This should be specified to <g> tag's id attribute.

style attribute

Remove style element of background's <g> tag.
background layer will become invisible by build script.
The build script insert style="display:none" after id="background", so if your icon file has style attribute on background's <g> tag, it will cause errors.

OK:

  <g
      inkscape:label="background"
      inkscape:groupmode="layer"
      id="background"
      transform="translate(0,-1028.3622)">

NG:

  <g
      inkscape:label="background"
      inkscape:groupmode="layer"
      id="background"
      style="display:inline"
      transform="translate(0,-1028.3622)">

Sample app

You can check how they look like on Android app.
If you know a little about Android apps and have SDK environment, please try it.

Install

$ ./gradlew installDebug

How to add your icon

  1. Create icon with .svg format. Check guidelines carefully.
  2. Execute build.sh to generate your icons. (See below)
  3. Check if your icons are correctly generated.
  4. Add your icon to sample Android app. (See below)(optional)
  5. Check it on Android app. (optional)
  6. Edit app image with GIMP and drawable-xhdpi icon. (optional)
  7. Commit your icons.
  8. Send a pull request!

Generate icon files

Environment

This project's icons are generated by export_icons.
If you are a Mac OS X user, you can also install it with Homebrew.

$ brew tap ksoichiro/export_icons
$ brew install export_icons

How to generate

For convenience, all of the latest result images are included in dist directory.
If you add or edit .svg files, you should execute build.sh to re-generate images before committing .svg files.

Note that this script is designed for OS X users.

Edit Android app to add your icon

List definition is written on IconList class on Android app project.
So edit app/src/main/java/com/github/ksoichiro/appicons/IconList.

    public IconList() {
        :
        add(new Icon(R.drawable.ic_action_awesome, "ic_action_awesome"));
    }

After editing java file, please execute the following command to check if the app can be built successfully.

$ ./gradlew installDebug

Color samples

At first, generate images to a temporary directory:

$ mkdir tmp
$ ./build.sh -a -f src/ic_action_check3.svg
$ for i in $(find dist/*/res/drawable-hdpi/ic_action_check3*); do cp -p $i tmp; done

Then, open color.xcf with GIMP and import images in tmp directory as layers.