This repository was archived by the owner on Dec 19, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ export class LoadingIndicator {
29
29
private _messageId : number ;
30
30
private _detailsId : number ;
31
31
private _customViewId : number ;
32
+ private _loadersInstances : android . widget . PopupWindow [ ] ;
32
33
33
34
constructor ( ) {
34
35
this . _defaultProgressColor = new Color ( '#007DD6' ) ;
@@ -48,6 +49,7 @@ export class LoadingIndicator {
48
49
if ( ! this . _popOver ) {
49
50
setTimeout ( ( ) => {
50
51
this . _createPopOver ( context , options ) ;
52
+ this . _loadersInstances . push ( this . _popOver ) ;
51
53
} ) ;
52
54
} else {
53
55
this . _updatePopOver ( context , options ) ;
@@ -56,12 +58,28 @@ export class LoadingIndicator {
56
58
}
57
59
58
60
hide ( ) {
59
- if ( this . _popOver ) {
60
- this . _popOver . dismiss ( ) ;
61
+ let i = 0 ;
62
+ try {
63
+ this . _loadersInstances . forEach ( loader => {
64
+ if ( loader ) {
65
+ if ( this . _isShowing ( loader ) ) {
66
+ loader . dismiss ( ) ;
67
+ }
68
+ }
69
+ this . _loadersInstances . splice ( i , 1 ) ;
70
+ i ++ ;
71
+ } ) ;
72
+
61
73
this . _popOver = null ;
62
74
this . _currentProgressColor = null ;
75
+ } catch ( e ) {
76
+ console . log ( e )
63
77
}
64
78
}
79
+
80
+ private _isShowing ( loader : android . widget . PopupWindow ) {
81
+ return loader . isShowing ( ) ;
82
+ }
65
83
66
84
private _createPopOver ( context , options ?: OptionsCommon ) {
67
85
this . _popOver = new android . widget . PopupWindow ( ) ;
You can’t perform that action at this time.
0 commit comments