Skip to content

Commit

Permalink
Merge pull request #83 from dwmkerr/feat/ldpi-and-round-icons
Browse files Browse the repository at this point in the history
feat: support for android round icons and ldpi
  • Loading branch information
dwmkerr authored Apr 22, 2019
2 parents 99dbab7 + 0f53c3e commit 01432cc
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/android/AndroidManifest.icons.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
{
"icons": [
{ "path": "res/mipmap-hdpi/ic_launcher.png" , "size": "72x72" },
{ "path": "res/mipmap-mdpi/ic_launcher.png" , "size": "48x48" },
{ "path": "res/mipmap-xhdpi/ic_launcher.png" , "size": "96x96" },
{ "path": "res/mipmap-xxhdpi/ic_launcher.png" , "size": "144x144" },
{ "path": "res/mipmap-xxxhdpi/ic_launcher.png" , "size": "192x192" }
{ "path": "res/mipmap-ldpi/ic_launcher.png" , "size": "36x36" },
{ "path": "res/mipmap-ldpi/ic_launcher_round.png" , "size": "36x36" },
{ "path": "res/mipmap-mdpi/ic_launcher.png" , "size": "48x48" },
{ "path": "res/mipmap-mdpi/ic_launcher_round.png" , "size": "48x48" },
{ "path": "res/mipmap-hdpi/ic_launcher.png" , "size": "72x72" },
{ "path": "res/mipmap-hdpi/ic_launcher_round.png" , "size": "72x72" },
{ "path": "res/mipmap-xhdpi/ic_launcher.png" , "size": "96x96" },
{ "path": "res/mipmap-xhdpi/ic_launcher_round.png" , "size": "96x96" },
{ "path": "res/mipmap-xxhdpi/ic_launcher.png" , "size": "144x144" },
{ "path": "res/mipmap-xxhdpi/ic_launcher_round.png" , "size": "144x144" },
{ "path": "res/mipmap-xxxhdpi/ic_launcher.png" , "size": "192x192" },
{ "path": "res/mipmap-xxxhdpi/ic_launcher_round.png" , "size": "192x192" }
]
}
21 changes: 21 additions & 0 deletions src/android/generate-manifest-icons.specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,18 @@ const sourceIcon = '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.
Expand All @@ -30,11 +37,18 @@ describe('generate-manifest-icons', () => {

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',
];

// Delete all of the files we're expecting to create, then generate them.
Expand All @@ -52,11 +66,18 @@ describe('generate-manifest-icons', () => {

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',
];

// Delete all of the files we're expecting to create, then generate them.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 01432cc

Please sign in to comment.