massoudss / waveformSeekBar

Android Waveform SeekBar library
488 stars 81 forks source link

setSampleFrom blocks the ui #44

Closed filippinheiro closed 2 years ago

filippinheiro commented 2 years ago

The waveFormSeekbar.setSampleFrom(audioUrl) function blocks the ui thread for a few seconds, I added some coroutines so the function can fetch the sample in the IO thread, and then change the views accordingly in the proper ui thread

massoudss commented 2 years ago

Hi @filippinheiro thanks for your contribution! I think this challenge should be handled outside of lib! Developers should be free to use Coroutine, RxJava, etc to handle this. also may they want to show placeholder until a successful loading.