ankidroid/Anki-Android — pull request #461 by timrae (2014-09-01 11:41:38+00:00)
Title: Fixes to PR#458 on refactoring asynchronous loading of collection into Loader

PR#458 was incomplete as I had forgotten to get the error dialogs working for when there is an error loading the collection. I was planning on refactoring all of this code into `AnkiActivity`, which required us to refactor all the dialogs (something we've been wanting to do for a long time), but in the end I abandoned this because it would lead to an unclean inheritance structure, where we have to implement `onActivityResult()` in both `AnkiActivity` and its children.

Finally I came to a compromise where most of the functionality is retained in DeckPicker, but the Dialogs are properly refactored into several `DialogFragment` classes, and when `Activity`s which aren't `DeckPicker` have Collection load failures, they simply kick the user back to the DeckPicker which can deal with errors properly.

This was actually a huge amount of work, much more than I had even expected, but the error dialogs are now working properly when the collection fails to load properly, and I have reduced the number of warning in DeckPicker *signficantly*.

There were some other bugs that I fixed in the process, for example the "Neutral" button in `StyledDialog` for Android 4.x was on the right, whereas it's supposed to be in the middle.