Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/core/ui/dialogs/dialogs-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions packages/core/ui/dialogs/index.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -325,7 +325,7 @@ export function action(...args): Promise<string> {
return new Promise<string>((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) {
Expand Down
5 changes: 5 additions & 0 deletions packages/core/ui/dialogs/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down