File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ typedef struct {
1414 BOOL iPhone5;
1515 BOOL iPhone6;
1616 BOOL iPhone6Plus;
17+ BOOL iPhoneX;
1718 BOOL retina;
1819
1920} CDV_iOSDevice;
Original file line number Diff line number Diff line change @@ -70,6 +70,7 @@ - (CDV_iOSDevice) getCurrentDevice
7070 // this is appropriate for detecting the runtime screen environment
7171 device.iPhone6 = (device.iPhone && limit == 667.0 );
7272 device.iPhone6Plus = (device.iPhone && limit == 736.0 );
73+ device.iPhoneX = (device.iPhone && limit == 812.0 );
7374
7475 return device;
7576}
@@ -147,6 +148,20 @@ - (NSString*)getImageName:(UIInterfaceOrientation)currentOrientation delegate:(i
147148 break ;
148149 }
149150 }
151+ } else if (device.iPhoneX ) { // supports landscape
152+ if (isOrientationLocked) {
153+ imageName = [imageName stringByAppendingString: (supportsLandscape ? @" -Landscape" : @" " )];
154+ } else {
155+ switch (currentOrientation) {
156+ case UIInterfaceOrientationLandscapeLeft:
157+ case UIInterfaceOrientationLandscapeRight:
158+ imageName = [imageName stringByAppendingString: @" -Landscape" ];
159+ break ;
160+ default :
161+ break ;
162+ }
163+ }
164+ imageName = [imageName stringByAppendingString: @" -812h" ];
150165 }
151166
152167 return imageName;
You can’t perform that action at this time.
0 commit comments