@@ -168,57 +168,6 @@ function createAlertController(options: DialogOptions & MDCAlertControlerOptions
168168 // if (options.buttonFont) {
169169 // alertController.buttonFont = options.buttonFont.getUIFont(alertController.buttonFont);
170170 // }
171- if ( options . messageFont ) {
172- alertController . messageFont = options . messageFont . getUIFont ( alertController . messageFont ) ;
173- }
174- if ( options . titleFont ) {
175- alertController . titleFont = options . titleFont . getUIFont ( alertController . titleFont ) ;
176- }
177- if ( options . buttonInkColor ) {
178- alertController . buttonInkColor = options . buttonInkColor . ios ;
179- }
180- if ( options . buttonTitleColor ) {
181- alertController . buttonTitleColor = options . buttonTitleColor . ios ;
182- }
183- if ( options . scrimColor ) {
184- alertController . scrimColor = options . scrimColor . ios ;
185- }
186- if ( options . titleColor ) {
187- alertController . titleColor = options . titleColor . ios ;
188- // } else if (lblColor) {
189- // alertController.titleColor = lblColor.ios;
190- }
191- if ( options . titleIconTintColor ) {
192- alertController . titleIconTintColor = options . titleIconTintColor . ios ;
193- }
194- if ( options . messageColor ) {
195- alertController . messageColor = options . messageColor . ios ;
196- }
197- if ( options . elevation !== undefined ) {
198- alertController . elevation = options . elevation ;
199- }
200- if ( options . cornerRadius !== undefined ) {
201- alertController . cornerRadius = options . cornerRadius ;
202- // } else {
203- // alertController.cornerRadius = 2;
204- }
205- if ( options . titleIcon ) {
206- alertController . titleIcon = options . titleIcon . ios ;
207- }
208- if ( options . titleAlignment ) {
209- switch ( options . titleAlignment ) {
210- case 'initial' :
211- case 'left' :
212- alertController . titleAlignment = NSTextAlignment . Left ;
213- break ;
214- case 'center' :
215- alertController . titleAlignment = NSTextAlignment . Center ;
216- break ;
217- case 'right' :
218- alertController . titleAlignment = NSTextAlignment . Right ;
219- break ;
220- }
221- }
222171
223172 if ( options . view ) {
224173 const view =
@@ -286,7 +235,7 @@ export function alert(arg: any): Promise<any> {
286235 resolve ( result ) ;
287236 } ) ;
288237
289- showUIAlertController ( alertController ) ;
238+ showUIAlertController ( alertController , options ) ;
290239 } catch ( ex ) {
291240 reject ( ex ) ;
292241 }
@@ -300,7 +249,7 @@ export class AlertDialog {
300249 show ( resolve ?) {
301250 if ( ! this . alertController ) {
302251 this . alertController = createAlertController ( this . options , resolve ) ;
303- this . presentingController = showUIAlertController ( this . alertController ) ;
252+ this . presentingController = showUIAlertController ( this . alertController , this . options ) ;
304253 }
305254 }
306255 hide ( ) {
@@ -331,7 +280,7 @@ export function confirm(arg: any): Promise<boolean> {
331280 resolve ( r ) ;
332281 } ) ;
333282
334- showUIAlertController ( alertController ) ;
283+ showUIAlertController ( alertController , options ) ;
335284 } catch ( ex ) {
336285 reject ( ex ) ;
337286 }
@@ -422,7 +371,7 @@ export function prompt(arg: any): Promise<PromptResult> {
422371 if ( options . autoFocus ) {
423372 alertController . autoFocusTextField = textField ;
424373 }
425- showUIAlertController ( alertController ) ;
374+ showUIAlertController ( alertController , options ) ;
426375 } catch ( ex ) {
427376 reject ( ex ) ;
428377 }
@@ -499,7 +448,7 @@ export function login(arg: any): Promise<LoginResult> {
499448 if ( options . beforeShow ) {
500449 options . beforeShow ( options , userNameTextField , passwordTextField ) ;
501450 }
502- showUIAlertController ( alertController ) ;
451+ showUIAlertController ( alertController , options ) ;
503452 if ( options . autoFocus ) {
504453 alertController . autoFocusTextField = userNameTextField ;
505454 }
@@ -509,7 +458,7 @@ export function login(arg: any): Promise<LoginResult> {
509458 } ) ;
510459}
511460
512- function showUIAlertController ( alertController : MDCAlertController ) {
461+ function showUIAlertController ( alertController : MDCAlertController , options : DialogOptions & MDCAlertControlerOptions ) {
513462 // themer needs to be applied after actions creation
514463 const colorScheme = themer . getAppColorScheme ( ) as MDCSemanticColorScheme ;
515464 const scheme = MDCContainerScheme . alloc ( ) . init ( ) ;
@@ -518,6 +467,58 @@ function showUIAlertController(alertController: MDCAlertController) {
518467 }
519468 alertController . applyThemeWithScheme ( scheme ) ;
520469
470+ if ( options . messageFont ) {
471+ alertController . messageFont = options . messageFont . getUIFont ( alertController . messageFont ) ;
472+ }
473+ if ( options . titleFont ) {
474+ alertController . titleFont = options . titleFont . getUIFont ( alertController . titleFont ) ;
475+ }
476+ if ( options . buttonInkColor ) {
477+ alertController . buttonInkColor = options . buttonInkColor . ios ;
478+ }
479+ if ( options . buttonTitleColor ) {
480+ alertController . buttonTitleColor = options . buttonTitleColor . ios ;
481+ }
482+ if ( options . scrimColor ) {
483+ alertController . scrimColor = options . scrimColor . ios ;
484+ }
485+ if ( options . titleColor ) {
486+ alertController . titleColor = options . titleColor . ios ;
487+ // } else if (lblColor) {
488+ // alertController.titleColor = lblColor.ios;
489+ }
490+ if ( options . titleIconTintColor ) {
491+ alertController . titleIconTintColor = options . titleIconTintColor . ios ;
492+ }
493+ if ( options . messageColor ) {
494+ alertController . messageColor = options . messageColor . ios ;
495+ }
496+ if ( options . elevation !== undefined ) {
497+ alertController . elevation = options . elevation ;
498+ }
499+ if ( options . cornerRadius !== undefined ) {
500+ alertController . cornerRadius = options . cornerRadius ;
501+ // } else {
502+ // alertController.cornerRadius = 2;
503+ }
504+ if ( options . titleIcon ) {
505+ alertController . titleIcon = options . titleIcon . ios ;
506+ }
507+ if ( options . titleAlignment ) {
508+ switch ( options . titleAlignment ) {
509+ case 'initial' :
510+ case 'left' :
511+ alertController . titleAlignment = NSTextAlignment . Left ;
512+ break ;
513+ case 'center' :
514+ alertController . titleAlignment = NSTextAlignment . Center ;
515+ break ;
516+ case 'right' :
517+ alertController . titleAlignment = NSTextAlignment . Right ;
518+ break ;
519+ }
520+ }
521+
521522 let currentView = getCurrentPage ( ) || Application . getRootView ( ) ;
522523
523524 if ( currentView ) {
@@ -599,7 +600,7 @@ export function action(): Promise<string> {
599600 ) ;
600601 }
601602
602- showUIAlertController ( alertController ) ;
603+ showUIAlertController ( alertController , options ) ;
603604 } catch ( ex ) {
604605 reject ( ex ) ;
605606 }
0 commit comments