@@ -25,9 +25,9 @@ function isString(value): value is string {
2525 return typeof value === 'string' ;
2626}
2727
28- function createAlertDialogBuilder ( options ?: DialogOptions & MDCAlertControlerOptions ) : androidx . appcompat . app . AlertDialog . Builder {
28+ function createAlertDialogBuilder ( options ?: DialogOptions & MDCAlertControlerOptions ) {
2929 const activity = Application . android . foregroundActivity || ( Application . android . startActivity as globalAndroid . app . Activity ) ;
30- const builder = new androidx . appcompat . app . AlertDialog . Builder ( activity ) ;
30+ const builder = new com . google . android . material . dialog . MaterialAlertDialogBuilder ( activity ) ;
3131 builder . setTitle ( options && isString ( options . title ) ? options . title : null ) ;
3232 builder . setMessage ( options && isString ( options . message ) ? options . message : null ) ;
3333 if ( options . titleIcon ) {
@@ -138,7 +138,7 @@ function showDialog(dlg: androidx.appcompat.app.AlertDialog, options: DialogOpti
138138 return dlg ;
139139}
140140
141- function prepareAndCreateAlertDialog ( builder : androidx . appcompat . app . AlertDialog . Builder , options : ConfirmOptions & MDCAlertControlerOptions , callback ?: Function , validationArgs ?: ( r ) => any ) {
141+ function prepareAndCreateAlertDialog ( builder : com . google . android . material . dialog . MaterialAlertDialogBuilder , options : ConfirmOptions & MDCAlertControlerOptions , callback ?: Function , validationArgs ?: ( r ) => any ) {
142142 // onDismiss will always be called. Prevent calling callback multiple times
143143 let onDoneCalled = false ;
144144 const onDone = function ( result : boolean , dialog ?: android . content . DialogInterface ) {
@@ -252,7 +252,6 @@ export function alert(arg: any): Promise<void> {
252252 return new Promise < void > ( ( resolve , reject ) => {
253253 try {
254254 const defaultOptions = {
255- title : DialogStrings . ALERT ,
256255 okButtonText : DialogStrings . OK
257256 } ;
258257 const options = ! isDialogOptions ( arg ) ? Object . assign ( defaultOptions , { message : arg + '' } ) : Object . assign ( defaultOptions , arg ) ;
@@ -292,7 +291,6 @@ export function confirm(arg: any): Promise<boolean> {
292291 return new Promise < boolean > ( ( resolve , reject ) => {
293292 try {
294293 const defaultOptions = {
295- title : DialogStrings . CONFIRM ,
296294 okButtonText : DialogStrings . OK ,
297295 cancelButtonText : DialogStrings . CANCEL
298296 } ;
@@ -315,7 +313,6 @@ export function prompt(arg: any): Promise<PromptResult> {
315313 let options : PromptOptions & MDCAlertControlerOptions ;
316314
317315 const defaultOptions = {
318- title : DialogStrings . PROMPT ,
319316 okButtonText : DialogStrings . OK ,
320317 cancelButtonText : DialogStrings . CANCEL ,
321318 inputType : inputType . text
@@ -407,7 +404,6 @@ export function prompt(arg: any): Promise<PromptResult> {
407404export function login ( arg : any ) : Promise < LoginResult > {
408405 let options : LoginOptions & MDCAlertControlerOptions ;
409406 const defaultOptions = {
410- title : DialogStrings . LOGIN ,
411407 okButtonText : DialogStrings . OK ,
412408 cancelButtonText : DialogStrings . CANCEL
413409 } ;
@@ -515,7 +511,7 @@ export function action(arg: any): Promise<string> {
515511 return new Promise < string > ( ( resolve , reject ) => {
516512 try {
517513 const activity = Application . android . foregroundActivity || ( Application . android . startActivity as globalAndroid . app . Activity ) ;
518- const alert = new androidx . appcompat . app . AlertDialog . Builder ( activity ) ;
514+ const alert = new com . google . android . material . dialog . MaterialAlertDialogBuilder ( activity ) ;
519515 const message = options && isString ( options . message ) ? options . message : '' ;
520516 const title = options && isString ( options . title ) ? options . title : '' ;
521517 if ( options && options . cancelable === false ) {
0 commit comments