tingyik90 / snackprogressbar

Enhanced Snackbar with ProgressBar for Android.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Calling show() consecutively

tingyik90 opened this issue · comments

Apart from #26, when calling show() consecutively without dismiss(), e.g. showing "Updating database..." and if the result immediately returned to show "Database updated!", due to the way SnackbarManager works, it can trigger the callback differently than expected. Typically the call will be:

snackProgressBar1.show() 
snackProgressBar2.show()
snackProgressBar1.onDismissed()     // Due to snackProgressBar1 immediately dismissed before showing
snackProgressBar1.onShown()
snackProgressBar2.onShown()

This can mess up user operation if there are operations pending in the callback.

b4f3f98 makes sure that BaseCallback.onShown() is called first i.e. snackProgressBar1 has finished appear animation before showing the next in queue.