Revert "Revert "Allow creating custom dialogs in DialogPreference.""

This reverts commit 8015dcd57c79c7619c2bf617cd36bf4769809f0e.