Skip to content
Permalink
Browse files
CB-10263 Fix splashscreen plugin filenames for Asset Catalog
Github: close #69
  • Loading branch information
daserge committed Dec 29, 2015
1 parent 1e67606 commit d7841c7ec9fdf9de83645abdfc9ba6494ad74235
Showing 2 changed files with 19 additions and 1 deletion.
@@ -23,6 +23,7 @@
typedef struct {
BOOL iPhone;
BOOL iPad;
BOOL iPhone4;
BOOL iPhone5;
BOOL iPhone6;
BOOL iPhone6Plus;
@@ -156,6 +156,7 @@ - (CDV_iOSDevice) getCurrentDevice
device.iPad = (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad);
device.iPhone = (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone);
device.retina = ([mainScreen scale] == 2.0);
device.iPhone4 = (device.iPhone && limit == 480.0);
device.iPhone5 = (device.iPhone && limit == 568.0);
// note these below is not a true device detect, for example if you are on an
// iPhone 6/6+ but the app is scaled it will prob set iPhone5 as true, but
@@ -187,7 +188,23 @@ - (NSString*)getImageName:(UIInterfaceOrientation)currentOrientation delegate:(i
{
imageName = @"Default";
}


// Add Asset Catalog specific prefixes
if ([imageName isEqualToString:@"LaunchImage"])
{
if (device.iPhone4 || device.iPhone5 || device.iPad) {
imageName = [imageName stringByAppendingString:@"-700"];
} else if(device.iPhone6) {
imageName = [imageName stringByAppendingString:@"-800"];
} else if(device.iPhone6Plus) {
imageName = [imageName stringByAppendingString:@"-800"];
if (currentOrientation == UIInterfaceOrientationPortrait || currentOrientation == UIInterfaceOrientationPortraitUpsideDown)
{
imageName = [imageName stringByAppendingString:@"-Portrait"];
}
}
}

if (device.iPhone5)
{ // does not support landscape
imageName = [imageName stringByAppendingString:@"-568h"];

0 comments on commit d7841c7

Please sign in to comment.