dimanche 7 février 2016

How to implement "loading views" for async operations on Android in generic way?

Every application, which performs some background work on user requests, has to somehow indicate that is busy - usually showing some animated "loading view".

How this behavior can be implemented in generic way? By "generic" I mean:

  1. No copy-pasting xml/java code for each screen of the application (some base activity/fragment class with dynamic layout modification?)
  2. No code for showing/hiding "loading view" in concrete activity/fragment classes (publishing events when starting/finishing async operation?)

In other words, implementing some concrete screen, I don't have to think about loading views.

Has someone implemented something like this?

Aucun commentaire:

Enregistrer un commentaire