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 {
4949 if ( context ) {
5050 options = options || { } ;
5151 options . android = options . android || { } ;
52- options . userInteractionEnabled =
53- options . userInteractionEnabled !== undefined || true ;
52+ options . userInteractionEnabled = options . userInteractionEnabled !== undefined ;
5453
5554 if ( ! this . _popOver ) {
5655 this . _isCreatingPopOver = true ;
@@ -478,9 +477,15 @@ export class LoadingIndicator {
478477 options . mode !== Mode . CustomView &&
479478 options . mode === Mode . Indeterminate
480479 ) {
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+
484489 if ( options . color ) {
485490 this . _setColor ( options . color , progressView ) ;
486491 this . _currentProgressColor = new Color ( options . color ) ;
You can’t perform that action at this time.
0 commit comments