@@ -29,7 +29,6 @@ @interface RCTDevLoadingView () <NativeDevLoadingViewSpec>
29
29
@implementation RCTDevLoadingView {
30
30
UIWindow *_window;
31
31
UILabel *_label;
32
- UILabel *_host;
33
32
NSDate *_showDate;
34
33
BOOL _hiding;
35
34
dispatch_block_t _initialMessageBlock;
@@ -120,23 +119,14 @@ - (void)showMessage:(NSString *)message color:(UIColor *)color backgroundColor:(
120
119
if (@available (iOS 11.0 , *)) {
121
120
UIWindow *window = RCTSharedApplication ().keyWindow ;
122
121
self->_window =
123
- [[UIWindow alloc ] initWithFrame: CGRectMake (0 , 0 , screenSize.width, window.safeAreaInsets.top + 52 )];
124
- self->_label = [[UILabel alloc ] initWithFrame: CGRectMake (0 , window.safeAreaInsets.top, screenSize.width, 22 )];
125
- self->_host =
126
- [[UILabel alloc ] initWithFrame: CGRectMake (0 , window.safeAreaInsets.top + 20 , screenSize.width, 22 )];
127
- self->_host .font = [UIFont monospacedDigitSystemFontOfSize: 10.0 weight: UIFontWeightRegular];
128
- self->_host .textAlignment = NSTextAlignmentCenter;
129
-
130
- [self ->_window addSubview: self ->_label];
131
- [self ->_window addSubview: self ->_host];
132
-
122
+ [[UIWindow alloc ] initWithFrame: CGRectMake (0 , 0 , screenSize.width, window.safeAreaInsets.top + 10 )];
123
+ self->_label =
124
+ [[UILabel alloc ] initWithFrame: CGRectMake (0 , window.safeAreaInsets.top - 10 , screenSize.width, 20 )];
133
125
} else {
134
- self->_window = [[UIWindow alloc ] initWithFrame: CGRectMake (0 , 0 , screenSize.width, 22 )];
126
+ self->_window = [[UIWindow alloc ] initWithFrame: CGRectMake (0 , 0 , screenSize.width, 20 )];
135
127
self->_label = [[UILabel alloc ] initWithFrame: self ->_window.bounds];
136
-
137
- [self ->_window addSubview: self ->_label];
138
- // TODO: Add host to iOS < 11.0
139
128
}
129
+ [self ->_window addSubview: self ->_label];
140
130
141
131
self->_window .windowLevel = UIWindowLevelStatusBar + 1 ;
142
132
// set a root VC so rotation is supported
@@ -149,11 +139,6 @@ - (void)showMessage:(NSString *)message color:(UIColor *)color backgroundColor:(
149
139
self->_label .text = message;
150
140
self->_label .textColor = color;
151
141
152
- if (self->_host != nil ) {
153
- self->_host .text = [self getTextForHost ];
154
- self->_host .textColor = [self dimColor: color];
155
- }
156
-
157
142
self->_window .backgroundColor = backgroundColor;
158
143
self->_window .hidden = NO ;
159
144
@@ -186,11 +171,11 @@ - (void)showMessage:(NSString *)message color:(UIColor *)color backgroundColor:(
186
171
187
172
dispatch_async (dispatch_get_main_queue (), ^{
188
173
self->_hiding = true ;
189
- const NSTimeInterval MIN_PRESENTED_TIME = 0.5 ;
174
+ const NSTimeInterval MIN_PRESENTED_TIME = 0.6 ;
190
175
NSTimeInterval presentedTime = [[NSDate date ] timeIntervalSinceDate: self ->_showDate];
191
176
NSTimeInterval delay = MAX (0 , MIN_PRESENTED_TIME - presentedTime);
192
177
CGRect windowFrame = self->_window .frame ;
193
- [UIView animateWithDuration: 0.1
178
+ [UIView animateWithDuration: 0.25
194
179
delay: delay
195
180
options: 0
196
181
animations: ^{
@@ -216,7 +201,7 @@ - (void)showWithURL:(NSURL *)URL
216
201
return ;
217
202
#endif
218
203
color = [UIColor whiteColor ];
219
- backgroundColor = [UIColor colorWithHue: 105 saturation: 0 brightness: . 25 alpha: 1 ];
204
+ backgroundColor = [UIColor blackColor ];
220
205
message = [NSString stringWithFormat: @" Connect to %@ to develop JavaScript." , RCT_PACKAGER_NAME];
221
206
[self showMessage: message color: color backgroundColor: backgroundColor];
222
207
} else {
0 commit comments