Skip to content

Refactored "downloaders" to allow future development

NOTE: While this is primarily a refactor, without new features - and the new features will not be implemented for some time - I'm requesting it to be merged because it refactored the AppDetails screen. This is important because I'm about to start porting each Activity to appcompat-v7, and I will therefore be branching from this in order to change the AppDetails view.

Previously, there was one batch of code which downloaded repo indexes, and one which downloaded apk files (and the UIL one which downloaded icons). This unifies them all into the same Downloader class, which is subclassed into a HttpDownloader for now. In the future, it is likely to also be extended to allow a bunch of other protocols to allow downloading apps from more places than just a repo on the web.

In the process, AppDetails was refactored a bit. The downloading of apk files was intertwined quite deeply into the AppDetails activity, and I struggled a bit to follow the logic of that class. There were a few assumptions being made about local variables, which would cause errors if a developer didn't fully understand them. For example, when does the progress dialog exist, when should we use appid instead of app.id. Hopefully the logic is a little more straightforward now.

ProgressEvent handling stuff was also made more generic. Previously it was only for updating repos, but now it can be used for anything which requires progress/status/error messages.

Merge request reports