Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust the size of image used for splash screen #69

Open
Mihai-github opened this issue May 27, 2021 · 7 comments
Open

Adjust the size of image used for splash screen #69

Mihai-github opened this issue May 27, 2021 · 7 comments

Comments

@Mihai-github
Copy link

Hi,
Is there a way to adjust the size of the splash image, because the library does not resize it and I'm curious if there is a way to achieve this kind of result.

Here is the code I am running using Fastlane and the image is too big...

android_appicon(
appicon_image_file: 'src/assets/images/logos/development.png',
appicon_icon_types: [:splash_port, :splash_land],
appicon_path: 'android/app/src/development/res/mipmap',
appicon_filename: 'splash_icon'
)

Maybe some figured out how to solve this issue.

@Mihai-github
Copy link
Author

For Android I've found this option:
-> appicon_image_file
-> appicon_icon_types
-> appicon_path
-> appicon_filename
-> appicon_custom_sizes
-> generate_rounded

appicon_custom_sizes must be a Hash, but I don't know what kind or type must be...

@Mihai-github
Copy link
Author

Mihai-github commented May 31, 2021

Hey, I'm back... with the solution for anyone else who's gonna run into this problem and my approach will solve the problem.

Here's how I've solved this problem that is specific for android:

appicon_custom_sizes: {
'android/app/src/development/res/mipmap-port-ldpi/splash_icon.png' => '200x320',
'android/app/src/development/res/mipmap-port-mdpi/splash_icon.png' => '320x480',
'android/app/src/development/res/mipmap-port-hdpi/splash_icon.png' => '480x800',
'android/app/src/development/res/mipmap-port-xhdpi/splash_icon.png' => '720x1280',
'android/app/src/development/res/mipmap-port-xxhdpi/splash_icon.png' => '960x1600',
'android/app/src/development/res/mipmap-port-xxxhdpi/splash_icon.png' => '1280x1920',
'android/app/src/development/res/mipmap-land-ldpi/splash_icon.png' => '320x200',
'android/app/src/development/res/mipmap-land-mdpi/splash_icon.png' => '480x320',
'android/app/src/development/res/mipmap-land-hdpi/splash_icon.png' => '800x480',
'android/app/src/development/res/mipmap-land-xhdpi/splash_icon.png' => '1280x720',
'android/app/src/development/res/mipmap-land-xxhdpi/splash_icon.png' => '1600x960',
'android/app/src/development/res/mipmap-land-xxxhdpi/splash_icon.png' => '1920x1280',
}

If something is not clear just leave a comment and I will respond back. :D

@DwCleb
Copy link

DwCleb commented Feb 14, 2022

Hello @Mihai-github !

Can you explain the lane where you used this code?

Thanks

@Mihai-github
Copy link
Author

Hi @DwCleb,

in an android lane for generating the splash icon dynamically. The docs from what I saw at that time do not tell anything about this but from many trials and errors, in the logs, I saw this and came up with this solution to generate dynamic sizes for the splash icon. 

@DwCleb
Copy link

DwCleb commented Feb 16, 2022

@Mihai-github Thanks!

But the image still stretch or cut :/

@Mihai-github
Copy link
Author

Use an image 1024x1024. Also, keep in mind that the options that I gave you will work in most cases but sometimes for different phones resolutions you should make manually the changes.

You can check if the image fits ok for android in Android Studio and for Ios in Xcode.

@stvmachine
Copy link

Is there a way to achieve the same but for iOS?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants