File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,6 +23,11 @@ export interface CancelableOptions {
2323 * [Android only] Gets or sets if the dialog can be canceled by taping outside of the dialog.
2424 */
2525 cancelable ?: boolean ;
26+
27+ /**
28+ * [Android only] Sets the theme of the Dialog. Usable themes can be found: https://developer.android.com/reference/android/R.style
29+ */
30+ theme ?: number ;
2631}
2732
2833/**
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ function isString(value): value is string {
1212}
1313
1414function createAlertDialog ( options ?: DialogOptions ) : android . app . AlertDialog . Builder {
15- const alert = new android . app . AlertDialog . Builder ( androidApp . foregroundActivity ) ;
15+ const alert = new android . app . AlertDialog . Builder ( androidApp . foregroundActivity , options . theme ? options . theme : - 1 ) ;
1616 alert . setTitle ( options && isString ( options . title ) ? options . title : '' ) ;
1717 alert . setMessage ( options && isString ( options . message ) ? options . message : '' ) ;
1818 if ( options && options . cancelable === false ) {
@@ -325,7 +325,7 @@ export function action(...args): Promise<string> {
325325 return new Promise < string > ( ( resolve , reject ) => {
326326 try {
327327 const activity = androidApp . foregroundActivity || androidApp . startActivity ;
328- const alert = new android . app . AlertDialog . Builder ( activity ) ;
328+ const alert = new android . app . AlertDialog . Builder ( activity , options . theme ? options . theme : - 1 ) ;
329329 const message = options && isString ( options . message ) ? options . message : '' ;
330330 const title = options && isString ( options . title ) ? options . title : '' ;
331331 if ( options && options . cancelable === false ) {
Original file line number Diff line number Diff line change @@ -142,6 +142,11 @@ export interface CancelableOptions {
142142 * [Android only] Gets or sets if the dialog can be canceled by taping outside of the dialog.
143143 */
144144 cancelable ?: boolean ;
145+
146+ /**
147+ * [Android only] Sets the theme of the Dialog. Usable themes can be found: https://developer.android.com/reference/android/R.style
148+ */
149+ theme ?: number ;
145150}
146151
147152/**
You can’t perform that action at this time.
0 commit comments