Inflate custom view with a themed context

Currently, when passing a custom view, the inflation is done with the context of the caller, and not the one from the dialog. As a result, using theme attribute like ?android:attr/textColorPrimary does not work if the dialog theme is not the same as the activity (dark vs light for example).

This PR fixes this behavior by moving the inflation step in the dialog creation, when the context is already wrapped inside its dialog theme.