Make "Loading from pre-bundle" message more distinctive
Reviewed By: javache Differential Revision: D2849126 fb-gh-sync-id: 28b42650de3716b43d228e83ede215aaa9098858
This commit is contained in:
parent
f7cb745195
commit
c4b948f62e
|
@ -67,12 +67,10 @@ RCT_EXPORT_MODULE()
|
||||||
if (!_window && !RCTRunningInTestEnvironment()) {
|
if (!_window && !RCTRunningInTestEnvironment()) {
|
||||||
CGFloat screenWidth = [UIScreen mainScreen].bounds.size.width;
|
CGFloat screenWidth = [UIScreen mainScreen].bounds.size.width;
|
||||||
_window = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, screenWidth, 22)];
|
_window = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, screenWidth, 22)];
|
||||||
_window.backgroundColor = [UIColor blackColor];
|
|
||||||
_window.windowLevel = UIWindowLevelStatusBar + 1;
|
_window.windowLevel = UIWindowLevelStatusBar + 1;
|
||||||
|
|
||||||
_label = [[UILabel alloc] initWithFrame:_window.bounds];
|
_label = [[UILabel alloc] initWithFrame:_window.bounds];
|
||||||
_label.font = [UIFont systemFontOfSize:12.0];
|
_label.font = [UIFont systemFontOfSize:12.0];
|
||||||
_label.textColor = [UIColor grayColor];
|
|
||||||
_label.textAlignment = NSTextAlignmentCenter;
|
_label.textAlignment = NSTextAlignmentCenter;
|
||||||
|
|
||||||
[_window addSubview:_label];
|
[_window addSubview:_label];
|
||||||
|
@ -81,14 +79,17 @@ RCT_EXPORT_MODULE()
|
||||||
|
|
||||||
NSString *source;
|
NSString *source;
|
||||||
if (URL.fileURL) {
|
if (URL.fileURL) {
|
||||||
|
_window.backgroundColor = [UIColor greenColor];
|
||||||
|
_label.textColor = [UIColor whiteColor];
|
||||||
source = @"pre-bundled file";
|
source = @"pre-bundled file";
|
||||||
} else {
|
} else {
|
||||||
|
_window.backgroundColor = [UIColor blackColor];
|
||||||
|
_label.textColor = [UIColor grayColor];
|
||||||
source = [NSString stringWithFormat:@"%@:%@", URL.host, URL.port];
|
source = [NSString stringWithFormat:@"%@:%@", URL.host, URL.port];
|
||||||
}
|
}
|
||||||
|
|
||||||
_label.text = [NSString stringWithFormat:@"Loading from %@...", source];
|
_label.text = [NSString stringWithFormat:@"Loading from %@...", source];
|
||||||
_window.hidden = NO;
|
_window.hidden = NO;
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue