Splash screen wrong aspect ratio


#1

This was tested on a Samsung Galaxy Note 4 with a resolution of 1,440 x 2,560.

Here is the screen capture from the phone of the splash screen showing the stretched look:

Here is the largest picture I found from the res directory was generated without the stretching, but it didn’t match the resolution of the phone.
C:\Users\Thomas\ionic2\app\platforms\android\res\drawable-port-xxxhdpi\screen.png (dimension: 1280 x 1920)

The picture from the res directory has a different aspect ratio than the Galaxy Note 4.

In searching, I found others had similar issues with some phones. One of the resolution was to use this plugin:

https://github.com/apache/cordova-plugin-splashscreen and use the SplashMaintainAspectRatio preference setting to ensure the aspect ratio is maintained. Why is this still necessary for Ionic 2? In addition, how can I generate the right splash screen in the res directory with the same aspect ratio as the Note 4?


#2

I should clarify that I did get it to work when I removed the plugin and added back in to get the latest:

ionic plugin rm cordova-plugin-splashscreen
ionic plugin add https://github.com/apache/cordova-plugin-splashscreen.git

and added to config.xml:

This works. I’m still curious why this was needed for the Note 4. I did some reading at:

http://vinsol.com/blog/2014/11/20/tips-for-designers-from-a-developer/

that talked about:

For keeping all these ‘screen resolution and density’ combinations simpler, Android wants us to consider them as DIP or DP units (Density Independent Pixels), which are corrected for density. For designing/development perspective, Android treats any device as its DP unit size instead of its actual pixel size. Android calculates DP size by using following formula:

DP size of any device is (actual resolution / density conversion factor).