(arg: any)
| 120 | } |
| 121 | |
| 122 | export function alert(arg: any): Promise<void> { |
| 123 | return new Promise<void>((resolve, reject) => { |
| 124 | try { |
| 125 | const options = !isDialogOptions(arg) ? { title: DialogStrings.ALERT, okButtonText: DialogStrings.OK, message: arg + '' } : arg; |
| 126 | |
| 127 | const alert = createAlertDialog(options); |
| 128 | |
| 129 | alert.setPositiveButton( |
| 130 | options.okButtonText, |
| 131 | new android.content.DialogInterface.OnClickListener({ |
| 132 | onClick: function (dialog: android.content.DialogInterface, id: number) { |
| 133 | dialog.cancel(); |
| 134 | resolve(); |
| 135 | }, |
| 136 | }), |
| 137 | ); |
| 138 | alert.setOnDismissListener( |
| 139 | new android.content.DialogInterface.OnDismissListener({ |
| 140 | onDismiss: function () { |
| 141 | resolve(); |
| 142 | }, |
| 143 | }), |
| 144 | ); |
| 145 | |
| 146 | showDialog(alert); |
| 147 | } catch (ex) { |
| 148 | reject(ex); |
| 149 | } |
| 150 | }); |
| 151 | } |
| 152 | |
| 153 | export function confirm(arg: any): Promise<boolean> { |
| 154 | return new Promise<boolean>((resolve, reject) => { |
nothing calls this directly
no test coverage detected