This is a port of emarashliev's original fix for CB-3562, cleaned up
to avoid deprecated functions.
Merge branch 'master' of https://github.com/emarashliev/cordova-plugin-splashscreen into CB3562
Signed-off-by: Shazron Abdullah <shazron@apache.org>
The viewController.interfaceOrientation passed to getImageName has not
yet been updated with the new orientation, even when the frame/bounds
change event has fired. Thus, the plugin never actually loads the
correct image for the new orientation. Instead, it poorly scales the
existing image.
This fix uses the statusBarOrientation property of the UIApplication
object to detect the actual orientation, and correctly load the right
image.
Signed-off-by: Shazron Abdullah <shazron@apache.org>
Sometimes the width can be 568 or 320 depending on orientation on iPhone 5. This fixes the detection.
Signed-off-by: Shazron Abdullah <shazron@apache.org>
When running Cordova apps without orientation lock on iPads, the
Splash Screen plugin didn't work properly. It would skip the iPad-
specific splash screen logic, and just select the image named
@"Default.png" (without adding the orientation suffix), and print
the following messages in the console:
WARNING: The splashscreen image named Default was not found
Now, for iPads, the splash screen image is set by first looking
at the position of the orientation lock, and if that is not set, it
uses the calculated view orientation.
close#19
The splash screen is shown with a faulty aspect ratio for landscape-only
applications on iPhone/iPod touch devices. This is fixed by applying
a 90° rotational transformation.
Signed-off-by: Michael Hanselmann <public@hansmi.ch>