ankidroid/Anki-Android — pull request #365 by agrueneberg (2014-05-17 14:52:37+00:00)
Title: Convert dialogs into DialogFragments

**Work in progress, please do not merge yet.**

I'm sure we've all seen the deprecation warning on `showDialog`. You're supposed to use `DialogFragment`s now. Unfortunately, they are not as easy to use as the former, but the transition should be made to effectively support dialogs in fragments (you can call `getActivity().showDialog()` from a fragment, but then the activity has to delegate the `onCreateDialog` call back to the fragment—quite messy). Therefore, my goal is to convert all dialogs into `DialogFragment`s.

Before starting the task I'd like to collect some feedback, though. Right now I let a method called `showDialogFragment` create and show a corresponding `DialogFragment` that is stored in a dedicated class in the `com.ichi2.anki.dialogs` package (I'm open to naming suggestions). Each fragment defines an interface to be implemented by the activity that calls the dialog to act as a callback. That seems to be the recommended pattern. Any objections?