isleofcode / corber

CLI for building hybrid apps with Ember/Vue/Glimmer/Cordova
http://corber.io
MIT License
334 stars 99 forks source link

[opinion] icon and splashscreen generators should not be used from this lib #523

Open lone-cloud opened 6 years ago

lone-cloud commented 6 years ago

Not sure if it's worth listing this in the corber.io documentation.

Android: icons: the generator only produces legacy icons. I think it's much better to create icons through android studio here as they also produce the new adaptive icons for >=Oreo devices. splashscreen: OK

iOS: icons: OK splashscreen: the generator doesn't produce the new storyboard style splashscreens which are required for the app to be displayed well (no top black bar) on an iPhone X.

ddoria921 commented 6 years ago

I would like to see the new asset size requirements for both iOS & Android worked into the generators. I find the existing generators very valuable.

alexblom commented 6 years ago

I agree we should extend Android support where possible.

We've debated pulling the generators out to their own repo that can be used with / without corber a little better. Icons is our only use of PhantomJS, which feels a little heavy for those not using our icon generators.

MatthewPringle commented 5 years ago

I would suggest creating an android project just to make the new icon using Android Studio. You can have this inside a resources folder where Cordova can grab them when adding the android platform.

Just open Image Asset Studio in Android Studio and you can import a SVG or PNG, position and save. It's actually really good.

I also found adding <preference name="SplashMaintainAspectRatio" value="true" /> made the currently generated splashscreens work a lot better on tall phones.

<resource-file src="../resources/icons/android/app/src/main/res/drawable/ic_launcher_foreground.xml" target="app/src/main/res/drawable/ic_launcher_foreground.xml" />
<resource-file src="../resources/icons/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml" target="app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml" />
<resource-file src="../resources/icons/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml" target="app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml" />
<resource-file src="../resources/icons/android/app/src/main/res/mipmap-mdpi/ic_launcher.png" target="app/src/main/res/mipmap-mdpi/ic_launcher.png" />
<resource-file src="../resources/icons/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png" target="app/src/main/res/mipmap-mdpi/ic_launcher_round.png" />
<resource-file src="../resources/icons/android/app/src/main/res/mipmap-hdpi/ic_launcher.png" target="app/src/main/res/mipmap-hdpi/ic_launcher.png" />
<resource-file src="../resources/icons/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png" target="app/src/main/res/mipmap-hdpi/ic_launcher_round.png" />
<resource-file src="../resources/icons/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png" target="app/src/main/res/mipmap-xhdpi/ic_launcher.png" />
<resource-file src="../resources/icons/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png" target="app/src/main/res/mipmap-xhdpi/ic_launcher_round.png" />
<resource-file src="../resources/icons/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png" target="app/src/main/res/mipmap-xxhdpi/ic_launcher.png" />
<resource-file src="../resources/icons/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png" target="app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png" />
<resource-file src="../resources/icons/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png" target="app/src/main/res/mipmap-xxxhdpi/ic_launcher.png" />
<resource-file src="../resources/icons/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png" target="app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png" />
<resource-file src="../resources/icons/android/app/src/main/res/values/ic_launcher_background.xml" target="app/src/main/res/values/ic_launcher_background.xml" />
joshmccall221 commented 5 years ago

@hoboman313 , this would be great addition to the docs.

If the icon generator is pulled out or Android Studio is preferred it would be great to keep existing functionality or at least the command that prints out how to do things better.

Our CI/CD currently relies on generate-[icons/splash] commands since we generate each build.

DuBistKomisch commented 5 years ago

For the record, I don't believe the iOS splashscreen complaint in the OP to be correct, as I fixed it in https://github.com/isleofcode/splicon/pull/20 by adding an extra resolution which for some reason fixes the letterboxing without needing storyboard style splashes. This is still working for us.

Android adaptive icon support is a good idea. :+1:

DuBistKomisch commented 4 years ago

phantomjs-prebuilt is becoming more of a liability, is there any interest in porting splicon to e.g. puppeteer instead?

alternative a way to make it not required would be nice. making splicon a peer dependency is a bit hacky but could work?

P.S. I think the direct dependency of corber on svg2png is a leftover so can just be removed

alexblom commented 4 years ago

It really is getting in the way. I'd be open to that - alternatively I think in the short term we may remove those tools from the core lib and document the choices people have. If I can't have it resolved by next release I think we will need to take that approach.

MatthewPringle commented 4 years ago

All I do now for iOS splash screens is have one image, Default@2x~universal~anyany.png with a resolution of 2732 × 2732. Seems to work fine.

<platform name="ios">
<splash src="../resources/splash-screens/ios/Default@2x~universal~anyany.png"/>
</platform>
cmubo commented 2 years ago

Hey, any update on this? I've recently forked off myself and removed any reference to splicon due to PhantomJs breaking builds on the newer Apple M1 chipset, not sure if anyone else is having the same experience?

Forked branch