From 6cdb01d4322521396ba880804fa4fc6dc3a2659a Mon Sep 17 00:00:00 2001 From: Nikolay Tsonev Date: Mon, 31 Dec 2018 14:20:52 +0200 Subject: [PATCH] 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 --- tns-core-modules/ui/core/view/view.android.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tns-core-modules/ui/core/view/view.android.ts b/tns-core-modules/ui/core/view/view.android.ts index 447430691..66a3c6f25 100644 --- a/tns-core-modules/ui/core/view/view.android.ts +++ b/tns-core-modules/ui/core/view/view.android.ts @@ -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: