@@ -37,6 +37,7 @@ interface DialogOptions {
3737 owner : View ;
3838 fullscreen : boolean ;
3939 stretched : boolean ;
40+ cancelable : boolean ;
4041 shownCallback : ( ) => void ;
4142 dismissCallback : ( ) => void ;
4243}
@@ -117,6 +118,7 @@ function initializeDialogFragment() {
117118 public owner : View ;
118119 private _fullscreen : boolean ;
119120 private _stretched : boolean ;
121+ private _cancelable : boolean ;
120122 private _shownCallback : ( ) => void ;
121123 private _dismissCallback : ( ) => void ;
122124
@@ -130,6 +132,7 @@ function initializeDialogFragment() {
130132 const options = getModalOptions ( ownerId ) ;
131133 this . owner = options . owner ;
132134 this . _fullscreen = options . fullscreen ;
135+ this . _cancelable = options . cancelable ;
133136 this . _stretched = options . stretched ;
134137 this . _dismissCallback = options . dismissCallback ;
135138 this . _shownCallback = options . shownCallback ;
@@ -155,6 +158,7 @@ function initializeDialogFragment() {
155158 this . owner . verticalAlignment = "stretch" ;
156159 }
157160
161+ dialog . setCanceledOnTouchOutside ( this . _cancelable ) ;
158162 return dialog ;
159163 }
160164
@@ -589,7 +593,7 @@ export class View extends ViewCommon {
589593
590594 return result | ( childMeasuredState & layout . MEASURED_STATE_MASK ) ;
591595 }
592- protected _showNativeModalView ( parent : View , options : ShowModalOptions ) { //context: any, closeCallback: Function, fullscreen?: boolean, animated?: boolean, stretched?: boolean, iosOpts?: any) {
596+ protected _showNativeModalView ( parent : View , options : ShowModalOptions ) {
593597 super . _showNativeModalView ( parent , options ) ;
594598 if ( ! this . backgroundColor ) {
595599 this . backgroundColor = new Color ( "White" ) ;
@@ -606,6 +610,7 @@ export class View extends ViewCommon {
606610 owner : this ,
607611 fullscreen : ! ! options . fullscreen ,
608612 stretched : ! ! options . stretched ,
613+ cancelable : options . android ? ! ! options . android . cancelable : true ,
609614 shownCallback : ( ) => this . _raiseShownModallyEvent ( ) ,
610615 dismissCallback : ( ) => this . closeModal ( )
611616 }
0 commit comments