That's a cool animation. Not Kotlin related, though.
If I understand your problem right, instead of saying this animation should take x seconds to finish, you want to bind it to the progress of your network request, so that it behaves like a determine ProgressBar, right?
What you could do, is divide your animation into e.g. 5 states and build an animated-selector. When the progress reaches 20%, you can transition from the first state to the second and so on. More states would make it more precise. Here is an example that could be helpful:
https://medium.com/@saulmm2/from-design-to-android-part-2-2a6c141547d9