orhanobut / wasp

Compact and easy to use, 'all-in-one' android network solution

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Request: How can I add loading mechanism?

rinav opened this issue · comments

commented

I want to implement loading mechanism whenever Wasp is working or talking to http.
I want to implement in such a way that it's decoupled from all the activities, fragments and have no dependencies with them.

basically my idea is to display a drawable/image and rotate it via Animation Class, when the request is made.

I don't know how can I inject drawable into current context.

can you help us with some pointers?

Without context, you cannot use animator already, in any case you need to do in main thread. It's not good idea to couple wasp with ui operations.

commented

yes, you are right about context and UI on main thread, perhaps the idea was to show loading screen when we make network call at "only one place". I thought about interceptors but then tight coupling network calls with UI is a bad idea.