@@ -44,6 +44,7 @@ let DialogFragment: DialogFragment;
44
44
interface DialogOptions {
45
45
owner : View ;
46
46
fullscreen : boolean ;
47
+ animated : boolean ;
47
48
stretched : boolean ;
48
49
cancelable : boolean ;
49
50
shownCallback : ( ) => void ;
@@ -137,6 +138,7 @@ function initializeDialogFragment() {
137
138
class DialogFragmentImpl extends androidx . fragment . app . DialogFragment {
138
139
public owner : View ;
139
140
private _fullscreen : boolean ;
141
+ private _animated : boolean ;
140
142
private _stretched : boolean ;
141
143
private _cancelable : boolean ;
142
144
private _shownCallback : ( ) => void ;
@@ -153,6 +155,7 @@ function initializeDialogFragment() {
153
155
const options = getModalOptions ( ownerId ) ;
154
156
this . owner = options . owner ;
155
157
this . _fullscreen = options . fullscreen ;
158
+ this . _animated = options . animated ;
156
159
this . _cancelable = options . cancelable ;
157
160
this . _stretched = options . stretched ;
158
161
this . _dismissCallback = options . dismissCallback ;
@@ -178,6 +181,16 @@ function initializeDialogFragment() {
178
181
this . owner . verticalAlignment = "stretch" ;
179
182
}
180
183
184
+ // set the modal window animation
185
+ // https://github.com/NativeScript/NativeScript/issues/5989
186
+ if ( this . _animated ) {
187
+ dialog
188
+ . getWindow ( )
189
+ . setWindowAnimations (
190
+ android . R . style . Animation_Dialog
191
+ ) ;
192
+ }
193
+
181
194
dialog . setCanceledOnTouchOutside ( this . _cancelable ) ;
182
195
183
196
return dialog ;
@@ -629,6 +642,7 @@ export class View extends ViewCommon {
629
642
const dialogOptions : DialogOptions = {
630
643
owner : this ,
631
644
fullscreen : ! ! options . fullscreen ,
645
+ animated : ! ! options . animated ,
632
646
stretched : ! ! options . stretched ,
633
647
cancelable : options . android ? ! ! options . android . cancelable : true ,
634
648
shownCallback : ( ) => this . _raiseShownModallyEvent ( ) ,
@@ -1131,4 +1145,4 @@ createNativePercentLengthProperty({
1131
1145
createNativePercentLengthProperty ( {
1132
1146
setter : "_setMinHeightNative" ,
1133
1147
get setPixels ( ) { return org . nativescript . widgets . ViewHelper . setMinHeight ; }
1134
- } ) ;
1148
+ } ) ;
0 commit comments