@@ -25,9 +25,9 @@ function isString(value): value is string {
25
25
return typeof value === 'string' ;
26
26
}
27
27
28
- function createAlertDialogBuilder ( options ?: DialogOptions & MDCAlertControlerOptions ) : androidx . appcompat . app . AlertDialog . Builder {
28
+ function createAlertDialogBuilder ( options ?: DialogOptions & MDCAlertControlerOptions ) {
29
29
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 ) ;
31
31
builder . setTitle ( options && isString ( options . title ) ? options . title : null ) ;
32
32
builder . setMessage ( options && isString ( options . message ) ? options . message : null ) ;
33
33
if ( options . titleIcon ) {
@@ -138,7 +138,7 @@ function showDialog(dlg: androidx.appcompat.app.AlertDialog, options: DialogOpti
138
138
return dlg ;
139
139
}
140
140
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 ) {
142
142
// onDismiss will always be called. Prevent calling callback multiple times
143
143
let onDoneCalled = false ;
144
144
const onDone = function ( result : boolean , dialog ?: android . content . DialogInterface ) {
@@ -252,7 +252,6 @@ export function alert(arg: any): Promise<void> {
252
252
return new Promise < void > ( ( resolve , reject ) => {
253
253
try {
254
254
const defaultOptions = {
255
- title : DialogStrings . ALERT ,
256
255
okButtonText : DialogStrings . OK
257
256
} ;
258
257
const options = ! isDialogOptions ( arg ) ? Object . assign ( defaultOptions , { message : arg + '' } ) : Object . assign ( defaultOptions , arg ) ;
@@ -292,7 +291,6 @@ export function confirm(arg: any): Promise<boolean> {
292
291
return new Promise < boolean > ( ( resolve , reject ) => {
293
292
try {
294
293
const defaultOptions = {
295
- title : DialogStrings . CONFIRM ,
296
294
okButtonText : DialogStrings . OK ,
297
295
cancelButtonText : DialogStrings . CANCEL
298
296
} ;
@@ -315,7 +313,6 @@ export function prompt(arg: any): Promise<PromptResult> {
315
313
let options : PromptOptions & MDCAlertControlerOptions ;
316
314
317
315
const defaultOptions = {
318
- title : DialogStrings . PROMPT ,
319
316
okButtonText : DialogStrings . OK ,
320
317
cancelButtonText : DialogStrings . CANCEL ,
321
318
inputType : inputType . text
@@ -407,7 +404,6 @@ export function prompt(arg: any): Promise<PromptResult> {
407
404
export function login ( arg : any ) : Promise < LoginResult > {
408
405
let options : LoginOptions & MDCAlertControlerOptions ;
409
406
const defaultOptions = {
410
- title : DialogStrings . LOGIN ,
411
407
okButtonText : DialogStrings . OK ,
412
408
cancelButtonText : DialogStrings . CANCEL
413
409
} ;
@@ -515,7 +511,7 @@ export function action(arg: any): Promise<string> {
515
511
return new Promise < string > ( ( resolve , reject ) => {
516
512
try {
517
513
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 ) ;
519
515
const message = options && isString ( options . message ) ? options . message : '' ;
520
516
const title = options && isString ( options . title ) ? options . title : '' ;
521
517
if ( options && options . cancelable === false ) {
0 commit comments