Skip to content

Commit

Permalink
fixed 24dp generator
Browse files Browse the repository at this point in the history
added 36dp generator
  • Loading branch information
sterlp committed Feb 17, 2016
1 parent a56eecf commit be90d1b
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>org.sterl.svg2png</groupId>
<artifactId>svg2png</artifactId>
<packaging>jar</packaging>
<version>0.0.1-SNAPSHOT</version>
<version>0.2.0-SNAPSHOT</version>
<url>https://github.com/puel/SvgToPng</url>
<inceptionYear>2015</inceptionYear>
<name>Svg to PNG CL util</name>
Expand Down
11 changes: 9 additions & 2 deletions src/main/java/org/sterl/svg2png/CliOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ public enum CliOptions {
ANDROID_LAUNCH(null, "android-launch", false, "Android Launcher Icon config mdpi 48x48 -> xxxhdpi 192x192."),
ANDROID_ICON(null, "android-icon", false, "Android Icon (Action Bar, Dialog etc.) config mdpi 36x36 -> xxxhdpi 128x128."),
ANDROID_SMALL(null, "android-small", false, "Android Small default config from mdpi 24x24 -> xxxhdpi 96x96."),
ANDROID_24dp(null, "android-24dp", false, "Android 24dp icons, with suffix _24dp -- mdpi 24x24 -> xxxhdpi 96x96.")
ANDROID_24dp(null, "android-24dp", false, "Android 24dp icons, with suffix _24dp -- mdpi 24x24 -> xxxhdpi 96x96."),
ANDROID_36dp(null, "android-36dp", false, "Android 24dp icons, with suffix _36dp -- mdpi 36x36 -> xxxhdpi 144x011.")
;

private final String shortName;
Expand Down Expand Up @@ -80,7 +81,13 @@ public static OutputConfig parse(CommandLine cmd) {
}
} else if (cmd.hasOption(ANDROID_24dp.longName)) {
try {
result = m.readerFor(OutputConfig.class).readValue(CliOptions.class.getResourceAsStream("/android-launcher.json"));
result = m.readerFor(OutputConfig.class).readValue(CliOptions.class.getResourceAsStream("/android-24dp.json"));
} catch (Exception e) {
throw new RuntimeException(e);
}
} else if (cmd.hasOption(ANDROID_36dp.longName)) {
try {
result = m.readerFor(OutputConfig.class).readValue(CliOptions.class.getResourceAsStream("/android-36dp.json"));
} catch (Exception e) {
throw new RuntimeException(e);
}
Expand Down
30 changes: 30 additions & 0 deletions src/main/resources/android-36dp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"files": [
{
"directory": "drawable-xxxhdpi",
"nameSuffix": "_36dp",
"height": 144,
"width": 144
},{
"directory": "drawable-xxhdpi",
"nameSuffix": "_36dp",
"height": 96,
"width": 96
},{
"directory": "drawable-xhdpi",
"nameSuffix": "_36dp",
"height": 72,
"width": 72
},{
"directory": "drawable-hdpi",
"nameSuffix": "_36dp",
"height": 48,
"width": 48
},{
"directory": "drawable-mdpi",
"nameSuffix": "_36dp",
"height": 36,
"width": 36
}
]
}

0 comments on commit be90d1b

Please sign in to comment.