CB-7663 - prep for unit tests
This commit is contained in:
parent
e1f17d6665
commit
fcd628ffc9
@ -19,6 +19,7 @@
|
||||
|
||||
#import "CDVSplashScreen.h"
|
||||
#import <Cordova/CDVViewController.h>
|
||||
#import <Cordova/CDVScreenOrientationDelegate.h>
|
||||
|
||||
#define kSplashScreenDurationDefault 0.25f
|
||||
|
||||
@ -116,26 +117,25 @@
|
||||
[self.viewController.view removeObserver:self forKeyPath:@"bounds"];
|
||||
}
|
||||
|
||||
// Sets the view's frame and image.
|
||||
- (void)updateImage
|
||||
- (NSString*)getImageName:(id<CDVScreenOrientationDelegate>)screenOrientationDelegate
|
||||
{
|
||||
UIInterfaceOrientation orientation = self.viewController.interfaceOrientation;
|
||||
|
||||
|
||||
// Use UILaunchImageFile if specified in plist. Otherwise, use Default.
|
||||
NSString* imageName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UILaunchImageFile"];
|
||||
|
||||
|
||||
// Checks to see if the developer has locked the orientation to use only one of Portrait or Landscape
|
||||
CDVViewController* vc = (CDVViewController*)self.viewController;
|
||||
BOOL supportsLandscape = [vc supportsOrientation:UIInterfaceOrientationLandscapeLeft] || [vc supportsOrientation:UIInterfaceOrientationLandscapeRight];
|
||||
BOOL supportsPortrait = [vc supportsOrientation:UIInterfaceOrientationPortrait] || [vc supportsOrientation:UIInterfaceOrientationPortraitUpsideDown];
|
||||
BOOL isOrientationLocked = !(supportsPortrait && supportsLandscape);
|
||||
|
||||
|
||||
if (imageName) {
|
||||
imageName = [imageName stringByDeletingPathExtension];
|
||||
} else {
|
||||
imageName = @"Default";
|
||||
}
|
||||
|
||||
|
||||
if (CDV_IsIPhone5()) {
|
||||
imageName = [imageName stringByAppendingString:@"-568h"];
|
||||
} else if (CDV_IsIPad()) {
|
||||
@ -147,7 +147,7 @@
|
||||
case UIInterfaceOrientationLandscapeRight:
|
||||
imageName = [imageName stringByAppendingString:@"-Landscape"];
|
||||
break;
|
||||
|
||||
|
||||
case UIInterfaceOrientationPortrait:
|
||||
case UIInterfaceOrientationPortraitUpsideDown:
|
||||
default:
|
||||
@ -156,6 +156,14 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return imageName;
|
||||
}
|
||||
|
||||
// Sets the view's frame and image.
|
||||
- (void)updateImage
|
||||
{
|
||||
NSString* imageName = [self getImageName:(id<CDVScreenOrientationDelegate>)self.viewController];
|
||||
|
||||
if (![imageName isEqualToString:_curImageName]) {
|
||||
UIImage* img = [UIImage imageNamed:imageName];
|
||||
|
Loading…
x
Reference in New Issue
Block a user