Florian
12/01/2020, 6:58 AMinvokeOnCompletion
a good place to hide a progress bar if a Coroutine was either finished or cancelled?
.invokeOnCompletion {
_loading.postValue(false)
}
andylamax
12/01/2020, 6:59 AMandylamax
12/01/2020, 7:00 AMFlorian
12/01/2020, 8:58 AMFlorian
12/01/2020, 8:58 AMandylamax
12/01/2020, 9:38 AMFlorian
12/01/2020, 9:38 AMtravis
12/01/2020, 8:09 PMinvokeOnCompletion
):
https://gist.github.com/twyatt/c61ebc97dd891ff7a888311df857f619
Hopefully it's helpful.Florian
12/01/2020, 9:36 PMtravis
12/02/2020, 6:16 PMinvokeOnCompletion
should work just fine.
My personal preference is try-finally
as it has more capabilities if needed. Allows for more consistency in codebases for cases that need the capabilities of try
-finally
approach (rather than having some invokeOnCompletion
and some try
-finally
, just have all be try
-finally
). But that's just a preference.Florian
12/02/2020, 9:11 PMFlorian
12/02/2020, 9:11 PMandylamax
12/02/2020, 9:13 PMFlorian
12/02/2020, 9:13 PMandylamax
12/02/2020, 9:15 PMinvokeOnCompletion
would be the best way to go for your progress barFlorian
12/03/2020, 9:14 AM