1
- import * as application from '@nativescript/core/application' ;
2
- import { Color } from '@nativescript/core/color' ;
3
- import { ImageSource } from '@nativescript/core/image-source' ;
4
- import { screen } from '@nativescript/core/platform' ;
5
- import { Frame } from '@nativescript/core/ui/frame' ;
6
- import { ad as androidUtils } from '@nativescript/core/utils/utils' ;
1
+ import { Application , Color , ImageSource , Screen , Frame , Utils } from '@nativescript/core' ;
7
2
import { Mode , OptionsCommon } from './loading-indicator.common' ;
8
3
9
4
export * from './loading-indicator.common' ;
@@ -45,7 +40,7 @@ export class LoadingIndicator {
45
40
}
46
41
47
42
show ( options ?: OptionsCommon ) {
48
- const context = androidUtils . getApplicationContext ( ) ;
43
+ const context = Utils . android . getApplicationContext ( ) ;
49
44
if ( context ) {
50
45
options = options || { } ;
51
46
options . android = options . android || { } ;
@@ -193,7 +188,7 @@ export class LoadingIndicator {
193
188
android . view . ViewGroup . LayoutParams . WRAP_CONTENT
194
189
) ;
195
190
196
- const defaultPadding = 10 * screen . mainScreen . scale ;
191
+ const defaultPadding = 10 * Screen . mainScreen . scale ;
197
192
parentView . setPadding (
198
193
defaultPadding ,
199
194
defaultPadding ,
@@ -203,7 +198,7 @@ export class LoadingIndicator {
203
198
204
199
// handle margin option
205
200
if ( options . margin !== undefined ) {
206
- const margin = options . margin * screen . mainScreen . scale ;
201
+ const margin = options . margin * Screen . mainScreen . scale ;
207
202
parentViewParams . setMargins ( margin , margin , margin , margin ) ;
208
203
}
209
204
@@ -317,8 +312,8 @@ export class LoadingIndicator {
317
312
progressView . setBackgroundDrawable ( this . _getBackgroundDrawable ( ) ) ;
318
313
progressView . setLayoutParams (
319
314
new android . widget . LinearLayout . LayoutParams (
320
- 60 * screen . mainScreen . scale ,
321
- 60 * screen . mainScreen . scale
315
+ 60 * Screen . mainScreen . scale ,
316
+ 60 * Screen . mainScreen . scale
322
317
)
323
318
) ;
324
319
break ;
@@ -330,8 +325,8 @@ export class LoadingIndicator {
330
325
progressView . setBackgroundDrawable ( this . _getBackgroundDrawable ( ) ) ;
331
326
progressView . setLayoutParams (
332
327
new android . widget . LinearLayout . LayoutParams (
333
- 60 * screen . mainScreen . scale ,
334
- 60 * screen . mainScreen . scale
328
+ 60 * Screen . mainScreen . scale ,
329
+ 60 * Screen . mainScreen . scale
335
330
)
336
331
) ;
337
332
break ;
@@ -388,8 +383,8 @@ export class LoadingIndicator {
388
383
0
389
384
) ;
390
385
} else {
391
- this . _popOver . setWidth ( screen . mainScreen . widthPixels ) ;
392
- this . _popOver . setHeight ( screen . mainScreen . heightPixels ) ;
386
+ this . _popOver . setWidth ( Screen . mainScreen . widthPixels ) ;
387
+ this . _popOver . setHeight ( Screen . mainScreen . heightPixels ) ;
393
388
this . _popOver . showAtLocation ( view , android . view . Gravity . CENTER , 0 , 0 ) ;
394
389
}
395
390
}
@@ -643,8 +638,8 @@ export class LoadingIndicator {
643
638
progressView . setBackgroundDrawable ( this . _getBackgroundDrawable ( ) ) ;
644
639
progressView . setLayoutParams (
645
640
new android . widget . LinearLayout . LayoutParams (
646
- 60 * screen . mainScreen . scale ,
647
- 60 * screen . mainScreen . scale
641
+ 60 * Screen . mainScreen . scale ,
642
+ 60 * Screen . mainScreen . scale
648
643
)
649
644
) ;
650
645
return progressView ;
@@ -699,7 +694,7 @@ export class LoadingIndicator {
699
694
}
700
695
701
696
private _getResources ( ) {
702
- const ctx = application . android . foregroundActivity as android . app . Activity ;
697
+ const ctx = Application . android . foregroundActivity as android . app . Activity ;
703
698
return ctx . getResources ( ) ;
704
699
}
705
700
0 commit comments