diff --git a/README.md b/README.md
index e7b6169..a439b17 100644
--- a/README.md
+++ b/README.md
@@ -175,6 +175,8 @@ There is an excellent guide on developing Adaptive Icons [here](https://medium.c
To test how adaptive icons will look when animated, swiped, etc, the [Adaptive Icons](https://adapticon.tooo.io/) website by [Marius Claret](https://twitter.com/mariusclaret) is very useful!
+Note that Adaptive Icons of *all* supported sizes are generated. However, we also generate the `res/mipmap-anydpi-v26/` adaptive icon. This is a large size icon which Android from v26 onwards will automatically rescale as needed to all other sizes. This technically makes the density specific icons redundant. The reason we generate both is to ensure that after `generate` is run, *all* icons in the project will be consistent.
+
## Developer Guide
The only dependencies are Node 6 (or above) and Yarn.
diff --git a/bin/app-icon.js b/bin/app-icon.js
index 4a329d1..a50f11a 100755
--- a/bin/app-icon.js
+++ b/bin/app-icon.js
@@ -14,6 +14,17 @@ const init = require('../src/init/init');
const labelImage = require('../src/label/label-image');
const fileExists = require('../src/utils/file-exists');
+// Helper to throw an error if a file doesn't exist.
+const errorIfMissing = (filePath, errorMessage) => {
+ return fileExists(filePath).then((exists) => {
+ if (!exists) {
+ console.error(`${chalk.red('error')}: ${errorMessage}`);
+ return process.exit(1);
+ }
+ return true;
+ });
+};
+
// Create the program.
program
.version(pack.version);
@@ -25,25 +36,50 @@ program
.option('-i, --icon [icon]', "The icon to use. Defaults to 'icon.png'", 'icon.png')
.option('-s, --search [optional]', "The folder to search from. Defaults to './'", './')
.option('-p, --platforms [optional]', "The platforms to generate icons for. Defaults to 'android,ios'", 'android,ios')
- .action(({ icon, search, platforms }) => {
+ .option('--background-icon [optional]', "The background icon path. Defaults to 'icon.background.png'")
+ .option('--foreground-icon [optional]', "The foregroud icon path. Defaults to 'icon.foregroud.png'")
+ .option('--adaptive-icons [optional]', "Additionally, generate Android Adaptive Icon templates. Defaults to 'false'")
+ .action((parameters) => {
+ const {
+ icon,
+ backgroundIcon,
+ foregroundIcon,
+ search,
+ platforms,
+ adaptiveIcons,
+ } = parameters;
imagemagickCli.getVersion()
.then((version) => {
if (!version) {
console.error(' Error: ImageMagick must be installed. Try:');
console.error(' brew install imagemagick');
- return process.exit(1);
+ process.exit(1);
}
-
- // Check that we have a source icon.
- return fileExists(icon);
})
- .then((exists) => {
- if (!exists) {
- console.error(`Source file '${icon}' does not exist. Add the file or specify source icon with the '--icon' parameter.`);
- return process.exit(1);
+ .then(() => {
+ // Check we have the files we need.
+ const operations = [];
+ operations.push(errorIfMissing(icon, `Source file '${icon}' does not exist. Add the file or specify source icon with the '--icon' parameter.`));
+ if (adaptiveIcons) {
+ const checkPath = backgroundIcon || 'icon.background.png';
+ operations.push(errorIfMissing(checkPath, `Background icon file '${checkPath}' does not exist. Add the file or specify background icon with the '--background-icon' parameter.`));
}
+ if (adaptiveIcons) {
+ const checkPath = foregroundIcon || 'icon.foreground.png';
+ operations.push(errorIfMissing(checkPath, `Foreground icon file '${checkPath}' does not exist. Add the file or specify foreground icon with the '--foreground-icon' parameter.`));
+ }
+ return Promise.all(operations);
+ })
+ .then(() => {
// Generate some icons.
- return generate({ sourceIcon: icon, searchRoot: search, platforms });
+ return generate({
+ sourceIcon: icon,
+ backgroundIcon,
+ foregroundIcon,
+ searchRoot: search,
+ platforms,
+ adaptiveIcons,
+ });
})
.catch((generateErr) => {
console.error(chalk.red(`An error occurred generating the icons: ${generateErr.message}`));
@@ -98,7 +134,7 @@ program
.command('init')
.description('Initialises app icons by creating simple icon templates')
.option('-c, --caption [caption]', "An optional caption for the icon, e.g 'App'.")
- .option('--adaptive-icons', 'Additionally, generate Android Adaptive Icon templates')
+ .option('--adaptive-icons [optional]', "Additionally, generate Android Adaptive Icon templates. Defaults to 'false'")
.action((params) => {
const { caption, adaptiveIcons } = params;
imagemagickCli.getVersion()
diff --git a/package.json b/package.json
index 3a3c71e..83cf5ef 100644
--- a/package.json
+++ b/package.json
@@ -9,7 +9,7 @@
"scripts": {
"start": "./bin/app-icon.js",
"test": "mocha -t 10000 ./src/{,**/}*.specs.js",
- "test:debug": "mocha -d --inspect-brk -w --inspect ./src/{,**/}*.specs.js",
+ "test:debug": "mocha -d -w ./src/{,**/}*.specs.js",
"cov": "nyc mocha --timeout 10000 ./src/{,**/}*.specs.js",
"lint": "eslint .",
"release": "standard-version"
@@ -44,7 +44,8 @@
"chalk": "^2.3.0",
"commander": "^2.19.0",
"imagemagick-cli": "^0.5.0",
- "mkdirp": "^0.5.1"
+ "mkdirp": "^0.5.1",
+ "rimraf": "^2.6.3"
},
"nyc": {
"all": true,
diff --git a/src/android/AndroidManifest.adaptive-icons.json b/src/android/AndroidManifest.adaptive-icons.json
new file mode 100644
index 0000000..9edfdba
--- /dev/null
+++ b/src/android/AndroidManifest.adaptive-icons.json
@@ -0,0 +1,44 @@
+{
+ "adaptiveIcons": [
+ {
+ "folder": "res/mipmap-ldpi-v26",
+ "backgroundIcon": "ic_launcher_background.png",
+ "foregroundIcon": "ic_launcher_foreground.png",
+ "size": "36x36"
+ },
+ {
+ "folder": "res/mipmap-mdpi-v26",
+ "backgroundIcon": "ic_launcher_background.png",
+ "foregroundIcon": "ic_launcher_foreground.png",
+ "size": "48x48"
+ },
+ {
+ "folder": "res/mipmap-hdpi-v26",
+ "backgroundIcon": "ic_launcher_background.png",
+ "foregroundIcon": "ic_launcher_foreground.png",
+ "size": "72x72"
+ },
+ {
+ "folder": "res/mipmap-xhdpi-v26",
+ "backgroundIcon": "ic_launcher_background.png",
+ "foregroundIcon": "ic_launcher_foreground.png",
+ "size": "96x96"
+ },
+ {
+ "folder": "res/mipmap-xxhdpi-v26",
+ "backgroundIcon": "ic_launcher_background.png",
+ "foregroundIcon": "ic_launcher_foreground.png",
+ "size": "144x144"
+ },
+ {
+ "folder": "res/mipmap-xxxhdpi-v26",
+ "backgroundIcon": "ic_launcher_background.png",
+ "foregroundIcon": "ic_launcher_foreground.png",
+ "size": "192x192"
+ },
+ {
+ "comment": "Note that the anydpi folder will *not* contain icons - it contains a reference to the mipmaps for specific sizes",
+ "folder": "res/mipmap-anydpi-v26"
+ }
+ ]
+}
diff --git a/src/android/generate-manifest-adaptive-icons.js b/src/android/generate-manifest-adaptive-icons.js
new file mode 100644
index 0000000..4b1dc81
--- /dev/null
+++ b/src/android/generate-manifest-adaptive-icons.js
@@ -0,0 +1,64 @@
+const path = require('path');
+const fs = require('fs');
+const { EOL } = require('os');
+const mkdirp = require('mkdirp');
+
+const androidManifestAdaptiveIcons = require('./AndroidManifest.adaptive-icons.json');
+const resizeImage = require('../resize/resize-image');
+
+// The XML for the ic launcher manifest.
+// eslint-disable-next-line
+const icLauncherManifestXml =
+ `${EOL}`
+ + `${EOL}`
+ + ` ${EOL}`
+ + ` ${EOL}`
+ + `${EOL}`;
+
+// Generate Android Manifest icons given a manifest file.
+module.exports = function generateManifestIcons(backgroundIcon, foregroundIcon, manifest) {
+ // Create the object we will return.
+ const results = {
+ icons: [],
+ };
+
+ // We've got the manifest file, get the parent folder.
+ const manifestFolder = path.dirname(manifest);
+
+ // Generate each image in the full icon set, updating the contents.
+ return Promise.all(androidManifestAdaptiveIcons.adaptiveIcons.map((icon) => {
+ // Each icon lives in its own folder, so we'd better make sure that folder
+ // exists.
+ return new Promise((resolve, reject) => {
+ const resourceFolder = path.join(manifestFolder, icon.folder);
+ mkdirp(resourceFolder, (err) => {
+ if (err) return reject(err);
+
+ // Create the manifests, for the normal icons and round icons.
+ fs.writeFileSync(path.join(resourceFolder, 'ic_launcher.xml'), icLauncherManifestXml, 'utf8');
+ fs.writeFileSync(path.join(resourceFolder, 'ic_launcher_round.xml'), icLauncherManifestXml, 'utf8');
+
+ const operations = [];
+ // If the manifest requires us to generate icons for the folder, do so.
+ // Not *every* folder has icons - for example the 'anydpi' folder will
+ // not contain icons.
+ if (icon.backgroundIcon) {
+ const backgroundOutput = path.join(resourceFolder, icon.backgroundIcon);
+ operations.push(resizeImage(backgroundIcon, backgroundOutput, icon.size));
+ results.icons.push(backgroundOutput);
+ }
+ if (icon.foregroundIcon) {
+ const foregroundOutput = path.join(resourceFolder, icon.foregroundIcon);
+ operations.push(resizeImage(foregroundIcon, foregroundOutput, icon.size));
+ results.icons.push(foregroundOutput);
+ }
+ return resolve(Promise.all(operations));
+ });
+ });
+ })).then(() => {
+ // Before writing the contents file, sort the contents (otherwise
+ // they could be in a different order each time).
+ results.icons.sort();
+ return results;
+ });
+};
diff --git a/src/android/generate-manifest-adaptive-icons.specs.js b/src/android/generate-manifest-adaptive-icons.specs.js
new file mode 100644
index 0000000..ab20500
--- /dev/null
+++ b/src/android/generate-manifest-adaptive-icons.specs.js
@@ -0,0 +1,73 @@
+const { expect } = require('chai');
+const path = require('path');
+const deleteFolderIfExists = require('../utils/delete-folder-if-exists');
+const generateManifestAdaptiveIcons = require('./generate-manifest-adaptive-icons');
+const fileExists = require('../utils/file-exists');
+
+const backgroundIcon = './test/icon.background.png';
+const foregroundIcon = './test/icon.foreground.png';
+
+// The folders we expect to generate, relative to the manifest location.
+const expectedFolders = [
+ './res/mipmap-ldpi-v26',
+ './res/mipmap-hdpi-v26',
+ './res/mipmap-mdpi-v26',
+ './res/mipmap-xhdpi-v26',
+ './res/mipmap-xxhdpi-v26',
+ './res/mipmap-xxxhdpi-v26',
+ './res/mipmap-anydpi-v26',
+];
+
+// The files we expect in each of the folders above.
+const expectedFiles = [
+ './ic_launcher.xml',
+ './ic_launcher_round.xml',
+ './ic_launcher_background.png',
+ './ic_launcher_foreground.png',
+];
+
+// Create a test for each manifest.
+const testManifests = [{
+ projectName: 'React Native Manifest',
+ manifestPath: './test/ReactNativeIconTest/android/app/src/main/AndroidManifest.xml',
+}, {
+ projectName: 'Cordova Manifest',
+ manifestPath: './test/CordovaApp/platforms/android/src/main/AndroidManifest.xml',
+}, {
+ projectName: 'Native Manifest',
+ manifestPath: './test/NativeApp/android/native_app/src/main/AndroidManifest.xml',
+}];
+
+describe('generate-manifest-adaptive-icons', () => {
+ // Run each test.
+ testManifests.forEach(({ projectName, manifestPath }) => {
+ it(`should be able to generate adaptive icons for the ${projectName} manifest`, () => {
+ // Get the manifest folder, create an array of every icon we expect to see.
+ const manifestFolder = path.dirname(manifestPath);
+ const resourceFolders = expectedFolders.map(f => path.join(manifestFolder, f));
+ const resourceFoldersFiles = resourceFolders.reduce((allFiles, folder) => {
+ expectedFiles.forEach(ef => allFiles.push(path.join(folder, ef)));
+ return allFiles;
+ }, []);
+
+ // A bit of a hack here - the 'anydpi' folder should not contain any images,
+ // it just references the other mipmaps. So remove the anydpi folder images
+ // from the expected set of files.
+ const expectedPaths = resourceFoldersFiles.filter(f => !(/anydpi.*png$/.test(f)));
+ console.log(`Len: ${resourceFoldersFiles.length}`);
+ expectedPaths.forEach(f => console.log(`Expecting: ${f}`));
+
+ // Delete all of the folders we're expecting to create, then generate the icons.
+ return Promise.all(resourceFolders.map(deleteFolderIfExists))
+ .then(() => (
+ generateManifestAdaptiveIcons(backgroundIcon, foregroundIcon, manifestPath)
+ ))
+ .then(() => Promise.all(expectedPaths.map(fileExists)))
+ .then((filesDoExist) => {
+ filesDoExist.forEach((exists, index) => {
+ expect(exists, `${resourceFoldersFiles[index]} should be generated`).to.equal(true);
+ });
+ });
+ });
+ });
+});
diff --git a/src/android/generate-manifest-icons.specs.js b/src/android/generate-manifest-icons.specs.js
index 3e2bf4b..455e1bb 100644
--- a/src/android/generate-manifest-icons.specs.js
+++ b/src/android/generate-manifest-icons.specs.js
@@ -1,95 +1,61 @@
const { expect } = require('chai');
+const path = require('path');
const generateManifestIcons = require('./generate-manifest-icons');
-const deleteIfExists = require('../utils/delete-if-exists');
+const deleteFolderIfExists = require('../utils/delete-folder-if-exists');
const fileExists = require('../utils/file-exists');
-const sourceIcon = 'icon.png';
+const sourceIcon = './test/icon.png';
-describe('generate-manifest-icons', () => {
- it('should be able to generate icons for the React Native manifest', () => {
- const files = [
- 'test/ReactNativeIconTest/android/app/src/main/res/mipmap-ldpi/ic_launcher.png',
- 'test/ReactNativeIconTest/android/app/src/main/res/mipmap-ldpi/ic_launcher_round.png',
- 'test/ReactNativeIconTest/android/app/src/main/res/mipmap-hdpi/ic_launcher.png',
- 'test/ReactNativeIconTest/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png',
- 'test/ReactNativeIconTest/android/app/src/main/res/mipmap-mdpi/ic_launcher.png',
- 'test/ReactNativeIconTest/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png',
- 'test/ReactNativeIconTest/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png',
- 'test/ReactNativeIconTest/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png',
- 'test/ReactNativeIconTest/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png',
- 'test/ReactNativeIconTest/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png',
- 'test/ReactNativeIconTest/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png',
- 'test/ReactNativeIconTest/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png',
- ];
-
- // Delete all of the files we're expecting to create, then generate them.
- return Promise.all(files.map(f => deleteIfExists(f)))
- .then(() => (
- generateManifestIcons(sourceIcon, './test/ReactNativeIconTest/android/app/src/main/AndroidManifest.xml')
- ))
- .then(() => Promise.all(files.map(fileExists)))
- .then((filesDoExist) => {
- filesDoExist.forEach((exists, index) => {
- expect(exists, `${files[index]} should be generated`).to.equal(true);
- });
- });
- });
+// The folders we expect to generate, relative to the manifest location.
+const expectedFolders = [
+ './res/mipmap-ldpi',
+ './res/mipmap-hdpi',
+ './res/mipmap-mdpi',
+ './res/mipmap-xhdpi',
+ './res/mipmap-xxhdpi',
+ './res/mipmap-xxxhdpi',
+];
- it('should be able to generate icons for the Cordova manifest', () => {
- const files = [
- 'test/CordovaApp/platforms/android/res/mipmap-ldpi/ic_launcher.png',
- 'test/CordovaApp/platforms/android/res/mipmap-ldpi/ic_launcher_round.png',
- 'test/CordovaApp/platforms/android/res/mipmap-hdpi/ic_launcher.png',
- 'test/CordovaApp/platforms/android/res/mipmap-hdpi/ic_launcher_round.png',
- 'test/CordovaApp/platforms/android/res/mipmap-mdpi/ic_launcher.png',
- 'test/CordovaApp/platforms/android/res/mipmap-mdpi/ic_launcher_round.png',
- 'test/CordovaApp/platforms/android/res/mipmap-xhdpi/ic_launcher.png',
- 'test/CordovaApp/platforms/android/res/mipmap-xhdpi/ic_launcher_round.png',
- 'test/CordovaApp/platforms/android/res/mipmap-xxhdpi/ic_launcher.png',
- 'test/CordovaApp/platforms/android/res/mipmap-xxhdpi/ic_launcher_round.png',
- 'test/CordovaApp/platforms/android/res/mipmap-xxxhdpi/ic_launcher.png',
- 'test/CordovaApp/platforms/android/res/mipmap-xxxhdpi/ic_launcher_round.png',
- ];
+// The files we expect in each of the folders above.
+const expectedFiles = [
+ './ic_launcher.png',
+ './ic_launcher_round.png',
+];
+// Create a test for each manifest.
+const testManifests = [{
+ projectName: 'React Native Manifest',
+ manifestPath: './test/ReactNativeIconTest/android/app/src/main/AndroidManifest.xml',
+}, {
+ projectName: 'Cordova Manifest',
+ manifestPath: './test/CordovaApp/platforms/android/src/main/AndroidManifest.xml',
+}, {
+ projectName: 'Native Manifest',
+ manifestPath: './test/NativeApp/android/native_app/src/main/AndroidManifest.xml',
+}];
- // Delete all of the files we're expecting to create, then generate them.
- return Promise.all(files.map(f => deleteIfExists(f)))
- .then(() => (
- generateManifestIcons(sourceIcon, 'test/CordovaApp/platforms/android/AndroidManifest.xml')
- ))
- .then(() => Promise.all(files.map(fileExists)))
- .then((filesDoExist) => {
- filesDoExist.forEach((exists, index) => {
- expect(exists, `${files[index]} should be generated`).to.equal(true);
- });
- });
- });
-
- it('should be able to generate icons for the Native manifest', () => {
- const files = [
- 'test/NativeApp/android/native_app/src/main/res/mipmap-ldpi/ic_launcher.png',
- 'test/NativeApp/android/native_app/src/main/res/mipmap-ldpi/ic_launcher_round.png',
- 'test/NativeApp/android/native_app/src/main/res/mipmap-hdpi/ic_launcher.png',
- 'test/NativeApp/android/native_app/src/main/res/mipmap-hdpi/ic_launcher_round.png',
- 'test/NativeApp/android/native_app/src/main/res/mipmap-mdpi/ic_launcher.png',
- 'test/NativeApp/android/native_app/src/main/res/mipmap-mdpi/ic_launcher_round.png',
- 'test/NativeApp/android/native_app/src/main/res/mipmap-xhdpi/ic_launcher.png',
- 'test/NativeApp/android/native_app/src/main/res/mipmap-xhdpi/ic_launcher_round.png',
- 'test/NativeApp/android/native_app/src/main/res/mipmap-xxhdpi/ic_launcher.png',
- 'test/NativeApp/android/native_app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png',
- 'test/NativeApp/android/native_app/src/main/res/mipmap-xxxhdpi/ic_launcher.png',
- 'test/NativeApp/android/native_app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png',
- ];
+describe('generate-manifest-icons', () => {
+ // Run each test.
+ testManifests.forEach(({ projectName, manifestPath }) => {
+ it(`should be able to generate icons and round icons for the ${projectName} manifest`, () => {
+ // Get the manifest folder, create an array of every icon we expect to see.
+ const manifestFolder = path.dirname(manifestPath);
+ const resourceFolders = expectedFolders.map(f => path.join(manifestFolder, f));
+ const resourceFoldersFiles = resourceFolders.reduce((allFiles, folder) => {
+ expectedFiles.forEach(ef => allFiles.push(path.join(folder, ef)));
+ return allFiles;
+ }, []);
- // Delete all of the files we're expecting to create, then generate them.
- return Promise.all(files.map(f => deleteIfExists(f)))
- .then(() => (
- generateManifestIcons(sourceIcon, 'test/NativeApp/android/native_app/src/main/AndroidManifest.xml')
- ))
- .then(() => Promise.all(files.map(fileExists)))
- .then((filesDoExist) => {
- filesDoExist.forEach((exists, index) => {
- expect(exists, `${files[index]} should be generated`).to.equal(true);
+ // Delete all of the folders we're expecting to create, then generate the icons.
+ return Promise.all(resourceFolders.map(deleteFolderIfExists))
+ .then(() => (
+ generateManifestIcons(sourceIcon, manifestPath)
+ ))
+ .then(() => Promise.all(resourceFoldersFiles.map(fileExists)))
+ .then((filesDoExist) => {
+ filesDoExist.forEach((exists, index) => {
+ expect(exists, `${resourceFoldersFiles[index]} should be generated`).to.equal(true);
+ });
});
- });
+ });
});
});
diff --git a/src/generate.js b/src/generate.js
index 7e6b29c..a652ff8 100644
--- a/src/generate.js
+++ b/src/generate.js
@@ -3,14 +3,26 @@ const findIconsetFolders = require('./ios/find-iconset-folders');
const generateIconsetIcons = require('./ios/generate-iconset-icons');
const findAndroidManifests = require('./android/find-android-manifests');
const generateManifestIcons = require('./android/generate-manifest-icons');
+const generateManifestAdaptiveIcons = require('./android/generate-manifest-adaptive-icons');
const validateParameters = require('./validate-parameters');
module.exports = function generate(parameters) {
// Validate and coerce the parameters.
- const { sourceIcon, searchRoot, platforms } = validateParameters(parameters || {});
+ const {
+ sourceIcon,
+ backgroundIcon,
+ foregroundIcon,
+ searchRoot,
+ platforms,
+ adaptiveIcons,
+ } = validateParameters(parameters || {});
// Set up the results object.
- const results = { iconsets: [], manifests: [] };
+ const results = {
+ iconsets: [],
+ manifests: [],
+ adaptiveIconManifests: [],
+ };
return findIconsetFolders(searchRoot)
.then(iconSets => Promise.all(iconSets.map((iconset) => {
@@ -22,7 +34,7 @@ module.exports = function generate(parameters) {
.then(({ icons }) => {
results.iconsets.push({ iconset, icons });
icons.forEach((icon) => {
- console.log(` ${chalk.green('✓')} Generated ${icon}`);
+ console.log(` ${chalk.green('✓')} Generated icon ${icon}`);
});
console.log(` ${chalk.green('✓')} Updated Contents.json`);
});
@@ -32,12 +44,25 @@ module.exports = function generate(parameters) {
if (!platforms.includes('android')) return null;
console.log(`Found Android Manifest: ${manifest}...`);
- return generateManifestIcons(sourceIcon, manifest).then(({ icons }) => {
- results.manifests.push({ manifest, icons });
- icons.forEach((icon) => {
- console.log(` ${chalk.green('✓')} Generated ${icon}`);
- });
- });
+ const operations = [
+ generateManifestIcons(sourceIcon, manifest).then(({ icons }) => {
+ results.manifests.push({ manifest, icons });
+ icons.forEach((icon) => {
+ console.log(` ${chalk.green('✓')} Generated icon ${icon}`);
+ });
+ }),
+ ];
+
+ if (adaptiveIcons) {
+ operations.push(generateManifestAdaptiveIcons(backgroundIcon, foregroundIcon, manifest)
+ .then(({ icons }) => {
+ results.adaptiveIconManifests.push({ manifest, icons });
+ icons.forEach((icon) => {
+ console.log(` ${chalk.green('✓')} Generated adaptive icon ${icon}`);
+ });
+ }));
+ }
+ return Promise.all(operations);
})))
.then(() => results);
};
diff --git a/src/generate.specs.js b/src/generate.specs.js
index 87adb4b..286b7f5 100644
--- a/src/generate.specs.js
+++ b/src/generate.specs.js
@@ -4,7 +4,7 @@ const generate = require('./generate');
describe('generate', () => {
it('should be able to generate test app icons', () => {
const parameters = {
- sourceIcon: 'icon.png',
+ sourceIcon: './test/icon.png',
searchPath: './',
};
@@ -16,4 +16,23 @@ describe('generate', () => {
expect(results.manifests.length).to.equal(4);
});
});
+
+ it('should be able to generate test app icons with adaptive icons included', () => {
+ const parameters = {
+ sourceIcon: './test/icon.png',
+ backgroundIcon: './test/icon.background.png',
+ foregroundIcon: './test/icon.foreground.png',
+ searchPath: './',
+ adaptiveIcons: true,
+ };
+
+ // Delete all of the files we're expecting to create, then generate them.
+ return generate(parameters).then((results) => {
+ // TODO: Check we found the manifests etc etc
+ expect(results).not.to.equal(null);
+ expect(results.iconsets.length).to.equal(3);
+ expect(results.manifests.length).to.equal(4);
+ expect(results.adaptiveIconManifests.length).to.equal(4);
+ });
+ });
});
diff --git a/src/ios/generate-iconset-icons.specs.js b/src/ios/generate-iconset-icons.specs.js
index d770a2e..d4be730 100644
--- a/src/ios/generate-iconset-icons.specs.js
+++ b/src/ios/generate-iconset-icons.specs.js
@@ -3,7 +3,7 @@ const generateIconsetIcons = require('./generate-iconset-icons');
const deleteIfExists = require('../utils/delete-if-exists');
const fileExists = require('../utils/file-exists');
-const sourceIcon = 'icon.png';
+const sourceIcon = './test/icon.png';
describe('generate-iconset-icons', () => {
it('should be able to generate icons for the React Native iconset', () => {
diff --git a/src/utils/delete-folder-if-exists.js b/src/utils/delete-folder-if-exists.js
new file mode 100644
index 0000000..ee50332
--- /dev/null
+++ b/src/utils/delete-folder-if-exists.js
@@ -0,0 +1,11 @@
+const rimraf = require('rimraf');
+
+// Helper to delete a folder if it exists.
+const deleteFolderIfExists = folder => new Promise((resolve, reject) => {
+ rimraf(folder, {}, (err) => {
+ if (err) return reject(err);
+ return resolve();
+ });
+});
+
+module.exports = deleteFolderIfExists;
diff --git a/src/utils/delete-folder-if-exists.specs.js b/src/utils/delete-folder-if-exists.specs.js
new file mode 100644
index 0000000..abce664
--- /dev/null
+++ b/src/utils/delete-folder-if-exists.specs.js
@@ -0,0 +1,25 @@
+const { expect } = require('chai');
+const assert = require('assert');
+const fs = require('fs');
+const deleteFolderIfExists = require('./delete-folder-if-exists');
+
+describe('delete-folder-if-exists', () => {
+ it('should be able to delete an existing folder', () => {
+ const testFolder = './temp-folder';
+ if (!fs.existsSync(testFolder)) fs.mkdirSync(testFolder);
+ return deleteFolderIfExists(testFolder)
+ .then(() => {
+ expect(fs.existsSync(testFolder)).to.equal(false);
+ });
+ });
+
+ it('should handle errors as rejections', () => {
+ return deleteFolderIfExists(undefined)
+ .then(() => {
+ assert.fail('deletion should fail - missing path');
+ })
+ .catch((err) => {
+ expect(err.message).to.match(/missing path/);
+ });
+ });
+});
diff --git a/src/validate-parameters.js b/src/validate-parameters.js
index 6f3f7af..b8abc68 100644
--- a/src/validate-parameters.js
+++ b/src/validate-parameters.js
@@ -7,6 +7,7 @@ module.exports = function validateParameters(parameters) {
// Validate or assign the platforms.
const platformsString = parameters.platforms || 'android,ios';
+
const platforms = platformsString.split(',');
for (let i = 0; i < platforms.length; i += 1) {
if (!/android|ios/.test(platforms[i])) {
@@ -14,5 +15,18 @@ module.exports = function validateParameters(parameters) {
}
}
- return { sourceIcon, searchRoot, platforms };
+ // Validate or assign the adaptive icons flag.
+ // Set default values for the adaptive icons paths.
+ const adaptiveIcons = !!parameters.adaptiveIcons;
+ const backgroundIcon = parameters.backgroundIcon || 'icon.background.png';
+ const foregroundIcon = parameters.foregroundIcon || 'icon.foreground.png';
+
+ return {
+ sourceIcon,
+ backgroundIcon,
+ foregroundIcon,
+ searchRoot,
+ platforms,
+ adaptiveIcons,
+ };
};
diff --git a/src/validate-parameters.specs.js b/src/validate-parameters.specs.js
index 7e6e31f..f500bc0 100644
--- a/src/validate-parameters.specs.js
+++ b/src/validate-parameters.specs.js
@@ -5,8 +5,11 @@ describe('validateParameters', () => {
function validParameters() {
return {
sourceIcon: 'icon.png',
+ backgroundIcon: 'icon.background.png',
+ foregroundIcon: 'icon.foreground.png',
searchRoot: './',
platforms: 'android,ios',
+ adaptiveIcons: false,
};
}
@@ -17,6 +20,20 @@ describe('validateParameters', () => {
assert.equal(parameters.sourceIcon, 'icon.png');
});
+ it('should provide a default background icon', () => {
+ const params = validParameters();
+ delete params.backgroundIcon;
+ const parameters = validateParameters(params);
+ assert.equal(parameters.backgroundIcon, 'icon.background.png');
+ });
+
+ it('should provide a default foreground icon', () => {
+ const params = validParameters();
+ delete params.foregroundIcon;
+ const parameters = validateParameters(params);
+ assert.equal(parameters.foregroundIcon, 'icon.foreground.png');
+ });
+
it('should provide a default search root', () => {
const params = validParameters();
delete params.searchRoot;
@@ -24,6 +41,13 @@ describe('validateParameters', () => {
assert.equal(parameters.searchRoot, './');
});
+ it('should provide a default adaptive icons option', () => {
+ const params = validParameters();
+ delete params.adaptiveIcons;
+ const parameters = validateParameters(params);
+ assert.equal(parameters.adaptiveIcons, false);
+ });
+
it('should provide a default set of platforms', () => {
const params = validParameters();
delete params.platforms;
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-anydpi-v26/ic_launcher.xml b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..8ae0e29
--- /dev/null
+++ b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-anydpi-v26/ic_launcher_background.png b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-anydpi-v26/ic_launcher_background.png
new file mode 100644
index 0000000..3e4163e
Binary files /dev/null and b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-anydpi-v26/ic_launcher_background.png differ
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-anydpi-v26/ic_launcher_foreground.png b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-anydpi-v26/ic_launcher_foreground.png
new file mode 100644
index 0000000..fd4e35f
Binary files /dev/null and b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-anydpi-v26/ic_launcher_foreground.png differ
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-anydpi-v26/ic_launcher_round.xml b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..8ae0e29
--- /dev/null
+++ b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-hdpi-v26/ic_launcher.xml b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-hdpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..8ae0e29
--- /dev/null
+++ b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-hdpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-hdpi-v26/ic_launcher_background.png b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-hdpi-v26/ic_launcher_background.png
new file mode 100644
index 0000000..2e43466
Binary files /dev/null and b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-hdpi-v26/ic_launcher_background.png differ
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-hdpi-v26/ic_launcher_foreground.png b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-hdpi-v26/ic_launcher_foreground.png
new file mode 100644
index 0000000..6eb7579
Binary files /dev/null and b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-hdpi-v26/ic_launcher_foreground.png differ
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-hdpi-v26/ic_launcher_round.xml b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-hdpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..8ae0e29
--- /dev/null
+++ b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-hdpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-hdpi/ic_launcher.png b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-hdpi/ic_launcher.png
index d4e69f2..4f2e502 100644
Binary files a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-hdpi/ic_launcher.png and b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-hdpi/ic_launcher_round.png b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-hdpi/ic_launcher_round.png
index d4e69f2..4f2e502 100644
Binary files a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-hdpi/ic_launcher_round.png and b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-ldpi-v26/ic_launcher.xml b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-ldpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..8ae0e29
--- /dev/null
+++ b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-ldpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-ldpi-v26/ic_launcher_background.png b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-ldpi-v26/ic_launcher_background.png
new file mode 100644
index 0000000..6f86c2e
Binary files /dev/null and b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-ldpi-v26/ic_launcher_background.png differ
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-ldpi-v26/ic_launcher_foreground.png b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-ldpi-v26/ic_launcher_foreground.png
new file mode 100644
index 0000000..5f3921d
Binary files /dev/null and b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-ldpi-v26/ic_launcher_foreground.png differ
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-ldpi-v26/ic_launcher_round.xml b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-ldpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..8ae0e29
--- /dev/null
+++ b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-ldpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-ldpi/ic_launcher.png b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-ldpi/ic_launcher.png
index 8635b16..11eccce 100644
Binary files a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-ldpi/ic_launcher.png and b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-ldpi/ic_launcher.png differ
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-ldpi/ic_launcher_round.png b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-ldpi/ic_launcher_round.png
index 8635b16..11eccce 100644
Binary files a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-ldpi/ic_launcher_round.png and b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-ldpi/ic_launcher_round.png differ
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-mdpi-v26/ic_launcher.xml b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-mdpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..8ae0e29
--- /dev/null
+++ b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-mdpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-mdpi-v26/ic_launcher_background.png b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-mdpi-v26/ic_launcher_background.png
new file mode 100644
index 0000000..e13950c
Binary files /dev/null and b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-mdpi-v26/ic_launcher_background.png differ
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-mdpi-v26/ic_launcher_foreground.png b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-mdpi-v26/ic_launcher_foreground.png
new file mode 100644
index 0000000..6da9a5d
Binary files /dev/null and b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-mdpi-v26/ic_launcher_foreground.png differ
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-mdpi-v26/ic_launcher_round.xml b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-mdpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..8ae0e29
--- /dev/null
+++ b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-mdpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-mdpi/ic_launcher.png b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-mdpi/ic_launcher.png
index d6fb663..4ae722e 100644
Binary files a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-mdpi/ic_launcher.png and b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-mdpi/ic_launcher_round.png b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-mdpi/ic_launcher_round.png
index d6fb663..4ae722e 100644
Binary files a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-mdpi/ic_launcher_round.png and b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xhdpi-v26/ic_launcher.xml b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xhdpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..8ae0e29
--- /dev/null
+++ b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xhdpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xhdpi-v26/ic_launcher_background.png b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xhdpi-v26/ic_launcher_background.png
new file mode 100644
index 0000000..2e1b99a
Binary files /dev/null and b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xhdpi-v26/ic_launcher_background.png differ
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xhdpi-v26/ic_launcher_foreground.png b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xhdpi-v26/ic_launcher_foreground.png
new file mode 100644
index 0000000..2eb975c
Binary files /dev/null and b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xhdpi-v26/ic_launcher_foreground.png differ
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xhdpi-v26/ic_launcher_round.xml b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xhdpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..8ae0e29
--- /dev/null
+++ b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xhdpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xhdpi/ic_launcher.png b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xhdpi/ic_launcher.png
index 4984ebc..1ef1ef6 100644
Binary files a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xhdpi/ic_launcher.png and b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xhdpi/ic_launcher_round.png b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xhdpi/ic_launcher_round.png
index 4984ebc..1ef1ef6 100644
Binary files a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xhdpi/ic_launcher_round.png and b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxhdpi-v26/ic_launcher.xml b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxhdpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..8ae0e29
--- /dev/null
+++ b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxhdpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxhdpi-v26/ic_launcher_background.png b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxhdpi-v26/ic_launcher_background.png
new file mode 100644
index 0000000..963ada1
Binary files /dev/null and b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxhdpi-v26/ic_launcher_background.png differ
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxhdpi-v26/ic_launcher_foreground.png b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxhdpi-v26/ic_launcher_foreground.png
new file mode 100644
index 0000000..025aedc
Binary files /dev/null and b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxhdpi-v26/ic_launcher_foreground.png differ
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxhdpi-v26/ic_launcher_round.xml b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxhdpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..8ae0e29
--- /dev/null
+++ b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxhdpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxhdpi/ic_launcher.png b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxhdpi/ic_launcher.png
index 716b591..b105d1a 100644
Binary files a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxhdpi/ic_launcher.png and b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxhdpi/ic_launcher_round.png b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxhdpi/ic_launcher_round.png
index 716b591..b105d1a 100644
Binary files a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxhdpi/ic_launcher_round.png and b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxxhdpi-v26/ic_launcher.xml b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxxhdpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..8ae0e29
--- /dev/null
+++ b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxxhdpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxxhdpi-v26/ic_launcher_background.png b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxxhdpi-v26/ic_launcher_background.png
new file mode 100644
index 0000000..f2f9fe4
Binary files /dev/null and b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxxhdpi-v26/ic_launcher_background.png differ
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxxhdpi-v26/ic_launcher_foreground.png b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxxhdpi-v26/ic_launcher_foreground.png
new file mode 100644
index 0000000..6e49734
Binary files /dev/null and b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxxhdpi-v26/ic_launcher_foreground.png differ
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxxhdpi-v26/ic_launcher_round.xml b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxxhdpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..8ae0e29
--- /dev/null
+++ b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxxhdpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxxhdpi/ic_launcher.png b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxxhdpi/ic_launcher.png
index 3d4da3d..38cb800 100644
Binary files a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxxhdpi/ic_launcher.png and b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxxhdpi/ic_launcher_round.png b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxxhdpi/ic_launcher_round.png
index 3d4da3d..38cb800 100644
Binary files a/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxxhdpi/ic_launcher_round.png and b/test/CordovaApp/platforms/android/CordovaLib/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/test/CordovaApp/platforms/android/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/test/CordovaApp/platforms/android/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..8ae0e29
--- /dev/null
+++ b/test/CordovaApp/platforms/android/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/test/CordovaApp/platforms/android/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/test/CordovaApp/platforms/android/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..8ae0e29
--- /dev/null
+++ b/test/CordovaApp/platforms/android/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/test/CordovaApp/platforms/android/src/main/res/mipmap-hdpi-v26/ic_launcher.xml b/test/CordovaApp/platforms/android/src/main/res/mipmap-hdpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..8ae0e29
--- /dev/null
+++ b/test/CordovaApp/platforms/android/src/main/res/mipmap-hdpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/test/CordovaApp/platforms/android/src/main/res/mipmap-hdpi-v26/ic_launcher_background.png b/test/CordovaApp/platforms/android/src/main/res/mipmap-hdpi-v26/ic_launcher_background.png
new file mode 100644
index 0000000..2e43466
Binary files /dev/null and b/test/CordovaApp/platforms/android/src/main/res/mipmap-hdpi-v26/ic_launcher_background.png differ
diff --git a/test/CordovaApp/platforms/android/src/main/res/mipmap-hdpi-v26/ic_launcher_foreground.png b/test/CordovaApp/platforms/android/src/main/res/mipmap-hdpi-v26/ic_launcher_foreground.png
new file mode 100644
index 0000000..6eb7579
Binary files /dev/null and b/test/CordovaApp/platforms/android/src/main/res/mipmap-hdpi-v26/ic_launcher_foreground.png differ
diff --git a/test/CordovaApp/platforms/android/src/main/res/mipmap-hdpi-v26/ic_launcher_round.xml b/test/CordovaApp/platforms/android/src/main/res/mipmap-hdpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..8ae0e29
--- /dev/null
+++ b/test/CordovaApp/platforms/android/src/main/res/mipmap-hdpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/test/CordovaApp/platforms/android/src/main/res/mipmap-hdpi/ic_launcher.png b/test/CordovaApp/platforms/android/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..4f2e502
Binary files /dev/null and b/test/CordovaApp/platforms/android/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/test/CordovaApp/platforms/android/src/main/res/mipmap-hdpi/ic_launcher_round.png b/test/CordovaApp/platforms/android/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 0000000..4f2e502
Binary files /dev/null and b/test/CordovaApp/platforms/android/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/test/CordovaApp/platforms/android/src/main/res/mipmap-ldpi-v26/ic_launcher.xml b/test/CordovaApp/platforms/android/src/main/res/mipmap-ldpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..8ae0e29
--- /dev/null
+++ b/test/CordovaApp/platforms/android/src/main/res/mipmap-ldpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/test/CordovaApp/platforms/android/src/main/res/mipmap-ldpi-v26/ic_launcher_background.png b/test/CordovaApp/platforms/android/src/main/res/mipmap-ldpi-v26/ic_launcher_background.png
new file mode 100644
index 0000000..6f86c2e
Binary files /dev/null and b/test/CordovaApp/platforms/android/src/main/res/mipmap-ldpi-v26/ic_launcher_background.png differ
diff --git a/test/CordovaApp/platforms/android/src/main/res/mipmap-ldpi-v26/ic_launcher_foreground.png b/test/CordovaApp/platforms/android/src/main/res/mipmap-ldpi-v26/ic_launcher_foreground.png
new file mode 100644
index 0000000..5f3921d
Binary files /dev/null and b/test/CordovaApp/platforms/android/src/main/res/mipmap-ldpi-v26/ic_launcher_foreground.png differ
diff --git a/test/CordovaApp/platforms/android/src/main/res/mipmap-ldpi-v26/ic_launcher_round.xml b/test/CordovaApp/platforms/android/src/main/res/mipmap-ldpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..8ae0e29
--- /dev/null
+++ b/test/CordovaApp/platforms/android/src/main/res/mipmap-ldpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/test/CordovaApp/platforms/android/src/main/res/mipmap-ldpi/ic_launcher.png b/test/CordovaApp/platforms/android/src/main/res/mipmap-ldpi/ic_launcher.png
new file mode 100644
index 0000000..11eccce
Binary files /dev/null and b/test/CordovaApp/platforms/android/src/main/res/mipmap-ldpi/ic_launcher.png differ
diff --git a/test/CordovaApp/platforms/android/src/main/res/mipmap-ldpi/ic_launcher_round.png b/test/CordovaApp/platforms/android/src/main/res/mipmap-ldpi/ic_launcher_round.png
new file mode 100644
index 0000000..11eccce
Binary files /dev/null and b/test/CordovaApp/platforms/android/src/main/res/mipmap-ldpi/ic_launcher_round.png differ
diff --git a/test/CordovaApp/platforms/android/src/main/res/mipmap-mdpi-v26/ic_launcher.xml b/test/CordovaApp/platforms/android/src/main/res/mipmap-mdpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..8ae0e29
--- /dev/null
+++ b/test/CordovaApp/platforms/android/src/main/res/mipmap-mdpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/test/CordovaApp/platforms/android/src/main/res/mipmap-mdpi-v26/ic_launcher_background.png b/test/CordovaApp/platforms/android/src/main/res/mipmap-mdpi-v26/ic_launcher_background.png
new file mode 100644
index 0000000..e13950c
Binary files /dev/null and b/test/CordovaApp/platforms/android/src/main/res/mipmap-mdpi-v26/ic_launcher_background.png differ
diff --git a/test/CordovaApp/platforms/android/src/main/res/mipmap-mdpi-v26/ic_launcher_foreground.png b/test/CordovaApp/platforms/android/src/main/res/mipmap-mdpi-v26/ic_launcher_foreground.png
new file mode 100644
index 0000000..6da9a5d
Binary files /dev/null and b/test/CordovaApp/platforms/android/src/main/res/mipmap-mdpi-v26/ic_launcher_foreground.png differ
diff --git a/test/CordovaApp/platforms/android/src/main/res/mipmap-mdpi-v26/ic_launcher_round.xml b/test/CordovaApp/platforms/android/src/main/res/mipmap-mdpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..8ae0e29
--- /dev/null
+++ b/test/CordovaApp/platforms/android/src/main/res/mipmap-mdpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/test/CordovaApp/platforms/android/src/main/res/mipmap-mdpi/ic_launcher.png b/test/CordovaApp/platforms/android/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..4ae722e
Binary files /dev/null and b/test/CordovaApp/platforms/android/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/test/CordovaApp/platforms/android/src/main/res/mipmap-mdpi/ic_launcher_round.png b/test/CordovaApp/platforms/android/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644
index 0000000..4ae722e
Binary files /dev/null and b/test/CordovaApp/platforms/android/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/test/CordovaApp/platforms/android/src/main/res/mipmap-xhdpi-v26/ic_launcher.xml b/test/CordovaApp/platforms/android/src/main/res/mipmap-xhdpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..8ae0e29
--- /dev/null
+++ b/test/CordovaApp/platforms/android/src/main/res/mipmap-xhdpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/test/CordovaApp/platforms/android/src/main/res/mipmap-xhdpi-v26/ic_launcher_background.png b/test/CordovaApp/platforms/android/src/main/res/mipmap-xhdpi-v26/ic_launcher_background.png
new file mode 100644
index 0000000..2e1b99a
Binary files /dev/null and b/test/CordovaApp/platforms/android/src/main/res/mipmap-xhdpi-v26/ic_launcher_background.png differ
diff --git a/test/CordovaApp/platforms/android/src/main/res/mipmap-xhdpi-v26/ic_launcher_foreground.png b/test/CordovaApp/platforms/android/src/main/res/mipmap-xhdpi-v26/ic_launcher_foreground.png
new file mode 100644
index 0000000..2eb975c
Binary files /dev/null and b/test/CordovaApp/platforms/android/src/main/res/mipmap-xhdpi-v26/ic_launcher_foreground.png differ
diff --git a/test/CordovaApp/platforms/android/src/main/res/mipmap-xhdpi-v26/ic_launcher_round.xml b/test/CordovaApp/platforms/android/src/main/res/mipmap-xhdpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..8ae0e29
--- /dev/null
+++ b/test/CordovaApp/platforms/android/src/main/res/mipmap-xhdpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/test/CordovaApp/platforms/android/src/main/res/mipmap-xhdpi/ic_launcher.png b/test/CordovaApp/platforms/android/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..1ef1ef6
Binary files /dev/null and b/test/CordovaApp/platforms/android/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/test/CordovaApp/platforms/android/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/test/CordovaApp/platforms/android/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..1ef1ef6
Binary files /dev/null and b/test/CordovaApp/platforms/android/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/test/CordovaApp/platforms/android/src/main/res/mipmap-xxhdpi-v26/ic_launcher.xml b/test/CordovaApp/platforms/android/src/main/res/mipmap-xxhdpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..8ae0e29
--- /dev/null
+++ b/test/CordovaApp/platforms/android/src/main/res/mipmap-xxhdpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/test/CordovaApp/platforms/android/src/main/res/mipmap-xxhdpi-v26/ic_launcher_background.png b/test/CordovaApp/platforms/android/src/main/res/mipmap-xxhdpi-v26/ic_launcher_background.png
new file mode 100644
index 0000000..963ada1
Binary files /dev/null and b/test/CordovaApp/platforms/android/src/main/res/mipmap-xxhdpi-v26/ic_launcher_background.png differ
diff --git a/test/CordovaApp/platforms/android/src/main/res/mipmap-xxhdpi-v26/ic_launcher_foreground.png b/test/CordovaApp/platforms/android/src/main/res/mipmap-xxhdpi-v26/ic_launcher_foreground.png
new file mode 100644
index 0000000..025aedc
Binary files /dev/null and b/test/CordovaApp/platforms/android/src/main/res/mipmap-xxhdpi-v26/ic_launcher_foreground.png differ
diff --git a/test/CordovaApp/platforms/android/src/main/res/mipmap-xxhdpi-v26/ic_launcher_round.xml b/test/CordovaApp/platforms/android/src/main/res/mipmap-xxhdpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..8ae0e29
--- /dev/null
+++ b/test/CordovaApp/platforms/android/src/main/res/mipmap-xxhdpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/test/CordovaApp/platforms/android/src/main/res/mipmap-xxhdpi/ic_launcher.png b/test/CordovaApp/platforms/android/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..b105d1a
Binary files /dev/null and b/test/CordovaApp/platforms/android/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/test/CordovaApp/platforms/android/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/test/CordovaApp/platforms/android/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..b105d1a
Binary files /dev/null and b/test/CordovaApp/platforms/android/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/test/CordovaApp/platforms/android/src/main/res/mipmap-xxxhdpi-v26/ic_launcher.xml b/test/CordovaApp/platforms/android/src/main/res/mipmap-xxxhdpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..8ae0e29
--- /dev/null
+++ b/test/CordovaApp/platforms/android/src/main/res/mipmap-xxxhdpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/test/CordovaApp/platforms/android/src/main/res/mipmap-xxxhdpi-v26/ic_launcher_background.png b/test/CordovaApp/platforms/android/src/main/res/mipmap-xxxhdpi-v26/ic_launcher_background.png
new file mode 100644
index 0000000..f2f9fe4
Binary files /dev/null and b/test/CordovaApp/platforms/android/src/main/res/mipmap-xxxhdpi-v26/ic_launcher_background.png differ
diff --git a/test/CordovaApp/platforms/android/src/main/res/mipmap-xxxhdpi-v26/ic_launcher_foreground.png b/test/CordovaApp/platforms/android/src/main/res/mipmap-xxxhdpi-v26/ic_launcher_foreground.png
new file mode 100644
index 0000000..6e49734
Binary files /dev/null and b/test/CordovaApp/platforms/android/src/main/res/mipmap-xxxhdpi-v26/ic_launcher_foreground.png differ
diff --git a/test/CordovaApp/platforms/android/src/main/res/mipmap-xxxhdpi-v26/ic_launcher_round.xml b/test/CordovaApp/platforms/android/src/main/res/mipmap-xxxhdpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..8ae0e29
--- /dev/null
+++ b/test/CordovaApp/platforms/android/src/main/res/mipmap-xxxhdpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/test/CordovaApp/platforms/android/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/test/CordovaApp/platforms/android/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..38cb800
Binary files /dev/null and b/test/CordovaApp/platforms/android/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/test/CordovaApp/platforms/android/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/test/CordovaApp/platforms/android/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..38cb800
Binary files /dev/null and b/test/CordovaApp/platforms/android/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/test/CordovaApp/platforms/ios/ionic_app/Images.xcassets/AppIcon.appiconset/iphone-29x29-3x.png b/test/CordovaApp/platforms/ios/ionic_app/Images.xcassets/AppIcon.appiconset/iphone-29x29-3x.png
index 8532359..25fb7a2 100644
Binary files a/test/CordovaApp/platforms/ios/ionic_app/Images.xcassets/AppIcon.appiconset/iphone-29x29-3x.png and b/test/CordovaApp/platforms/ios/ionic_app/Images.xcassets/AppIcon.appiconset/iphone-29x29-3x.png differ
diff --git a/test/CordovaApp/platforms/ios/ionic_app/Images.xcassets/AppIcon.appiconset/iphone-60x60-3x.png b/test/CordovaApp/platforms/ios/ionic_app/Images.xcassets/AppIcon.appiconset/iphone-60x60-3x.png
index 8378bb3..b828968 100644
Binary files a/test/CordovaApp/platforms/ios/ionic_app/Images.xcassets/AppIcon.appiconset/iphone-60x60-3x.png and b/test/CordovaApp/platforms/ios/ionic_app/Images.xcassets/AppIcon.appiconset/iphone-60x60-3x.png differ
diff --git a/test/NativeApp/ios/native_app/Assets.xcassets/AppIcon.appiconset/iphone-29x29-3x.png b/test/NativeApp/ios/native_app/Assets.xcassets/AppIcon.appiconset/iphone-29x29-3x.png
index 8532359..25fb7a2 100644
Binary files a/test/NativeApp/ios/native_app/Assets.xcassets/AppIcon.appiconset/iphone-29x29-3x.png and b/test/NativeApp/ios/native_app/Assets.xcassets/AppIcon.appiconset/iphone-29x29-3x.png differ
diff --git a/test/NativeApp/ios/native_app/Assets.xcassets/AppIcon.appiconset/iphone-60x60-3x.png b/test/NativeApp/ios/native_app/Assets.xcassets/AppIcon.appiconset/iphone-60x60-3x.png
index 8378bb3..b828968 100644
Binary files a/test/NativeApp/ios/native_app/Assets.xcassets/AppIcon.appiconset/iphone-60x60-3x.png and b/test/NativeApp/ios/native_app/Assets.xcassets/AppIcon.appiconset/iphone-60x60-3x.png differ
diff --git a/test/ReactNativeIconTest/android/app/src/main/ic_launcher_background.png b/test/ReactNativeIconTest/android/app/src/main/ic_launcher_background.png
new file mode 100644
index 0000000..f2f9fe4
Binary files /dev/null and b/test/ReactNativeIconTest/android/app/src/main/ic_launcher_background.png differ
diff --git a/test/ReactNativeIconTest/android/app/src/main/ic_launcher_foreground.png b/test/ReactNativeIconTest/android/app/src/main/ic_launcher_foreground.png
new file mode 100644
index 0000000..6e49734
Binary files /dev/null and b/test/ReactNativeIconTest/android/app/src/main/ic_launcher_foreground.png differ
diff --git a/test/icon.background.png b/test/icon.background.png
new file mode 100644
index 0000000..7e276f5
Binary files /dev/null and b/test/icon.background.png differ
diff --git a/test/icon.foreground.png b/test/icon.foreground.png
new file mode 100644
index 0000000..483285b
Binary files /dev/null and b/test/icon.foreground.png differ
diff --git a/icon.png b/test/icon.png
similarity index 100%
rename from icon.png
rename to test/icon.png