This repository was archived by the owner on Dec 19, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -49,8 +49,7 @@ export class LoadingIndicator {
49
49
if ( context ) {
50
50
options = options || { } ;
51
51
options . android = options . android || { } ;
52
- options . userInteractionEnabled =
53
- options . userInteractionEnabled !== undefined || true ;
52
+ options . userInteractionEnabled = options . userInteractionEnabled !== undefined ;
54
53
55
54
if ( ! this . _popOver ) {
56
55
this . _isCreatingPopOver = true ;
@@ -478,9 +477,15 @@ export class LoadingIndicator {
478
477
options . mode !== Mode . CustomView &&
479
478
options . mode === Mode . Indeterminate
480
479
) {
481
- const progressView = new android . widget . ProgressBar ( context ) ;
482
- progressView . setId ( this . _progressId ) ;
483
- parentView . addView ( progressView , 0 ) ;
480
+ /**
481
+ * Get the existing indicator if it exists, assess whether or not the
482
+ * acquired child is the correct class.
483
+ */
484
+ let progressView = parentView . getChildAt ( 0 ) ;
485
+ if ( progressView instanceof android . widget . ProgressBar === false || progressView === undefined ) {
486
+ progressView = new android . widget . ProgressBar ( context ) ;
487
+ }
488
+
484
489
if ( options . color ) {
485
490
this . _setColor ( options . color , progressView ) ;
486
491
this . _currentProgressColor = new Color ( options . color ) ;
You can’t perform that action at this time.
0 commit comments