set the correct application theme while creating the dialog fragment (#6691)

* set the correct application theme while creating the dialog fragment

* useing the new approche fusing the new approach for setting the theme only when the modal view is fullscreen(it will break the style when using non-fullscreen modal)

* note - get theme change

* set the correct application theme while creating the dialog fragment

* useing the new approche fusing the new approach for setting the theme only when the modal view is fullscreen(it will break the style when using non-fullscreen modal)

* note - get theme change
This commit is contained in:
Nikolay Tsonev
2018-12-31 14:20:52 +02:00
committed by GitHub
parent 2b7e7d89e0
commit 6cdb01d432

View File

@@ -135,8 +135,14 @@ function initializeDialogFragment() {
this._shownCallback = options.shownCallback;
this.owner._dialogFragment = this;
this.setStyle(android.support.v4.app.DialogFragment.STYLE_NO_TITLE, 0);
let theme = this.getTheme();
if (this._fullscreen) {
// In fullscreen mode, get the application's theme.
theme = this.getActivity().getApplicationInfo().theme;
}
const dialog = new DialogImpl(this, this.getActivity(), this.getTheme());
const dialog = new DialogImpl(this, this.getActivity(), theme);
// do not override alignment unless fullscreen modal will be shown;
// otherwise we might break component-level layout: