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>
There are two aspect ratios for Windows Phone devices: 15:9 and 16:9. At
the moment, though, there is only one splash screen by default for WP8
Cordova apps. When stretched to fit all possible resolutions, this can
sometimes look bad.
WP supports resolution-specific splashscreens, so this commit adds the
same support to the splashscreen plugin. It uses the same base name for
the splashscreen, but adds modifiers such as ".screen-<res>" based on
the device. If a screen-specific image is found, it is used. If not, we
fall back to the single default image.
Fixes https://issues.apache.org/jira/browse/CB-8750
github close#41
github close#42
When calling hide() from JS, the attempt to access Popup could happen on
a background thread, which ends up throwing an
UnauthorizedAccessException about cross-thread access.
To address this, it's best to check the popup's state from within the UI
thread.
Fixes https://issues.apache.org/jira/browse/CB-8758
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>