File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
ProgressStatusBar/src/main/java/com/basel/ProgressStatusBar Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -203,7 +203,9 @@ public void prepare(boolean isShowPercentage,boolean isWait) {
203
203
if (!isViewAdded ) {
204
204
windowManager .addView (mRelativeLayout , parameters );
205
205
isViewAdded = true ;
206
- pListener .onStart ();
206
+ if (pListener !=null ){
207
+ pListener .onStart ();
208
+ }
207
209
}
208
210
mRelativeLayout .setVisibility (VISIBLE );
209
211
if (isShowPercentage ) {
@@ -225,7 +227,9 @@ public void shwoToast(String message, int duration) {
225
227
if (!isViewAdded ) {
226
228
windowManager .addView (mRelativeLayout , parameters );
227
229
isViewAdded = true ;
228
- pListener .onStart ();
230
+ if (pListener !=null ){
231
+ pListener .onStart ();
232
+ }
229
233
}
230
234
mRelativeLayout .setVisibility (VISIBLE );
231
235
ballsHandler = new Handler ();
@@ -269,7 +273,9 @@ public void onAnimationUpdate(ValueAnimator animation) {
269
273
interprogress = (int ) (interpolation * (isfake ? 100 : progress ));
270
274
setProgress (interprogress , false , isfake );
271
275
mTextView .setText ("%" +interprogress );
272
- pListener .onUpdate (interprogress );
276
+ if (pListener !=null ){
277
+ pListener .onUpdate (interprogress );
278
+ }
273
279
}
274
280
});
275
281
if (!barProgress .isStarted ()) {
@@ -305,7 +311,9 @@ public void remove() {
305
311
isViewAdded = false ;
306
312
mRelativeLayout .setVisibility (GONE );
307
313
mTextView .setText ("" );
308
- pListener .onEnd ();
314
+ if (pListener !=null ){
315
+ pListener .onEnd ();
316
+ }
309
317
}
310
318
if (ballsHandler !=null &&ballsRunnable !=null ){
311
319
ballsHandler .removeCallbacks (ballsRunnable );
You can’t perform that action at this time.
0 commit comments