Skip to content

Commit

Permalink
allow changing launcher icon name, e.g. to something like ic_launcher…
Browse files Browse the repository at this point in the history
…_round. Fixes romannurik#49
  • Loading branch information
romannurik committed Jan 22, 2017
1 parent d464efc commit 57cc61c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions app/scripts/pages/LauncherIconGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,21 @@ export class LauncherIconGenerator extends BaseGenerator {
buttons: true,
options: DEFAULT_EFFECT_OPTIONS,
defaultValue: 'none'
}))
})),
new studio.TextField('name', {
title: 'Name',
defaultValue: 'ic_launcher'
})
]
});
this.form.onChange(field => this.regenerateDebounced_());
}

regenerate() {
let iconName = 'ic_launcher';
let values = this.form.getValues();

this.zipper.clear();
this.zipper.setZipFilename(iconName + '.zip');
this.zipper.setZipFilename(`${values.name}.zip`);

let xxxhdpiCtx = null;

Expand All @@ -156,7 +160,7 @@ export class LauncherIconGenerator extends BaseGenerator {
this.zipper.add({
name: (density == 'web')
? 'web_hi_res_512.png'
: `res/mipmap-${density}/${iconName}.png`,
: `res/mipmap-${density}/${values.name}.png`,
canvas: ctx.canvas
});

Expand Down

0 comments on commit 57cc61c

Please sign in to comment.