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' ;
72import { Mode , OptionsCommon } from './loading-indicator.common' ;
83
94export * from './loading-indicator.common' ;
@@ -45,7 +40,7 @@ export class LoadingIndicator {
4540 }
4641
4742 show ( options ?: OptionsCommon ) {
48- const context = androidUtils . getApplicationContext ( ) ;
43+ const context = Utils . android . getApplicationContext ( ) ;
4944 if ( context ) {
5045 options = options || { } ;
5146 options . android = options . android || { } ;
@@ -193,7 +188,7 @@ export class LoadingIndicator {
193188 android . view . ViewGroup . LayoutParams . WRAP_CONTENT
194189 ) ;
195190
196- const defaultPadding = 10 * screen . mainScreen . scale ;
191+ const defaultPadding = 10 * Screen . mainScreen . scale ;
197192 parentView . setPadding (
198193 defaultPadding ,
199194 defaultPadding ,
@@ -203,7 +198,7 @@ export class LoadingIndicator {
203198
204199 // handle margin option
205200 if ( options . margin !== undefined ) {
206- const margin = options . margin * screen . mainScreen . scale ;
201+ const margin = options . margin * Screen . mainScreen . scale ;
207202 parentViewParams . setMargins ( margin , margin , margin , margin ) ;
208203 }
209204
@@ -317,8 +312,8 @@ export class LoadingIndicator {
317312 progressView . setBackgroundDrawable ( this . _getBackgroundDrawable ( ) ) ;
318313 progressView . setLayoutParams (
319314 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
322317 )
323318 ) ;
324319 break ;
@@ -330,8 +325,8 @@ export class LoadingIndicator {
330325 progressView . setBackgroundDrawable ( this . _getBackgroundDrawable ( ) ) ;
331326 progressView . setLayoutParams (
332327 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
335330 )
336331 ) ;
337332 break ;
@@ -388,8 +383,8 @@ export class LoadingIndicator {
388383 0
389384 ) ;
390385 } 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 ) ;
393388 this . _popOver . showAtLocation ( view , android . view . Gravity . CENTER , 0 , 0 ) ;
394389 }
395390 }
@@ -643,8 +638,8 @@ export class LoadingIndicator {
643638 progressView . setBackgroundDrawable ( this . _getBackgroundDrawable ( ) ) ;
644639 progressView . setLayoutParams (
645640 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
648643 )
649644 ) ;
650645 return progressView ;
@@ -699,7 +694,7 @@ export class LoadingIndicator {
699694 }
700695
701696 private _getResources ( ) {
702- const ctx = application . android . foregroundActivity as android . app . Activity ;
697+ const ctx = Application . android . foregroundActivity as android . app . Activity ;
703698 return ctx . getResources ( ) ;
704699 }
705700
0 commit comments