diff --git a/packages/core/ui/dialogs/dialogs-common.ts b/packages/core/ui/dialogs/dialogs-common.ts index 1cf19b7cf..5fc160d16 100644 --- a/packages/core/ui/dialogs/dialogs-common.ts +++ b/packages/core/ui/dialogs/dialogs-common.ts @@ -23,6 +23,11 @@ export interface CancelableOptions { * [Android only] Gets or sets if the dialog can be canceled by taping outside of the dialog. */ cancelable?: boolean; + + /** + * [Android only] Sets the theme of the Dialog. Usable themes can be found: https://developer.android.com/reference/android/R.style + */ + theme?: number; } /** diff --git a/packages/core/ui/dialogs/index.android.ts b/packages/core/ui/dialogs/index.android.ts index c289ca2a3..79932e18a 100644 --- a/packages/core/ui/dialogs/index.android.ts +++ b/packages/core/ui/dialogs/index.android.ts @@ -12,7 +12,7 @@ function isString(value): value is string { } function createAlertDialog(options?: DialogOptions): android.app.AlertDialog.Builder { - const alert = new android.app.AlertDialog.Builder(androidApp.foregroundActivity); + const alert = new android.app.AlertDialog.Builder(androidApp.foregroundActivity, options.theme ? options.theme : -1); alert.setTitle(options && isString(options.title) ? options.title : ''); alert.setMessage(options && isString(options.message) ? options.message : ''); if (options && options.cancelable === false) { @@ -325,7 +325,7 @@ export function action(...args): Promise { return new Promise((resolve, reject) => { try { const activity = androidApp.foregroundActivity || androidApp.startActivity; - const alert = new android.app.AlertDialog.Builder(activity); + const alert = new android.app.AlertDialog.Builder(activity, options.theme ? options.theme : -1); const message = options && isString(options.message) ? options.message : ''; const title = options && isString(options.title) ? options.title : ''; if (options && options.cancelable === false) { diff --git a/packages/core/ui/dialogs/index.d.ts b/packages/core/ui/dialogs/index.d.ts index 2d80dfb22..2d34adbad 100644 --- a/packages/core/ui/dialogs/index.d.ts +++ b/packages/core/ui/dialogs/index.d.ts @@ -142,6 +142,11 @@ export interface CancelableOptions { * [Android only] Gets or sets if the dialog can be canceled by taping outside of the dialog. */ cancelable?: boolean; + + /** + * [Android only] Sets the theme of the Dialog. Usable themes can be found: https://developer.android.com/reference/android/R.style + */ + theme?: number; } /**