mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
@@ -44,6 +44,7 @@ let DialogFragment: DialogFragment;
|
|||||||
interface DialogOptions {
|
interface DialogOptions {
|
||||||
owner: View;
|
owner: View;
|
||||||
fullscreen: boolean;
|
fullscreen: boolean;
|
||||||
|
animated: boolean;
|
||||||
stretched: boolean;
|
stretched: boolean;
|
||||||
cancelable: boolean;
|
cancelable: boolean;
|
||||||
shownCallback: () => void;
|
shownCallback: () => void;
|
||||||
@@ -137,6 +138,7 @@ function initializeDialogFragment() {
|
|||||||
class DialogFragmentImpl extends androidx.fragment.app.DialogFragment {
|
class DialogFragmentImpl extends androidx.fragment.app.DialogFragment {
|
||||||
public owner: View;
|
public owner: View;
|
||||||
private _fullscreen: boolean;
|
private _fullscreen: boolean;
|
||||||
|
private _animated: boolean;
|
||||||
private _stretched: boolean;
|
private _stretched: boolean;
|
||||||
private _cancelable: boolean;
|
private _cancelable: boolean;
|
||||||
private _shownCallback: () => void;
|
private _shownCallback: () => void;
|
||||||
@@ -153,6 +155,7 @@ function initializeDialogFragment() {
|
|||||||
const options = getModalOptions(ownerId);
|
const options = getModalOptions(ownerId);
|
||||||
this.owner = options.owner;
|
this.owner = options.owner;
|
||||||
this._fullscreen = options.fullscreen;
|
this._fullscreen = options.fullscreen;
|
||||||
|
this._animated = options.animated;
|
||||||
this._cancelable = options.cancelable;
|
this._cancelable = options.cancelable;
|
||||||
this._stretched = options.stretched;
|
this._stretched = options.stretched;
|
||||||
this._dismissCallback = options.dismissCallback;
|
this._dismissCallback = options.dismissCallback;
|
||||||
@@ -178,6 +181,16 @@ function initializeDialogFragment() {
|
|||||||
this.owner.verticalAlignment = "stretch";
|
this.owner.verticalAlignment = "stretch";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// set the modal window animation
|
||||||
|
// https://github.com/NativeScript/NativeScript/issues/5989
|
||||||
|
if (this._animated) {
|
||||||
|
dialog
|
||||||
|
.getWindow()
|
||||||
|
.setWindowAnimations(
|
||||||
|
android.R.style.Animation_Dialog
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
dialog.setCanceledOnTouchOutside(this._cancelable);
|
dialog.setCanceledOnTouchOutside(this._cancelable);
|
||||||
|
|
||||||
return dialog;
|
return dialog;
|
||||||
@@ -629,6 +642,7 @@ export class View extends ViewCommon {
|
|||||||
const dialogOptions: DialogOptions = {
|
const dialogOptions: DialogOptions = {
|
||||||
owner: this,
|
owner: this,
|
||||||
fullscreen: !!options.fullscreen,
|
fullscreen: !!options.fullscreen,
|
||||||
|
animated: !!options.animated,
|
||||||
stretched: !!options.stretched,
|
stretched: !!options.stretched,
|
||||||
cancelable: options.android ? !!options.android.cancelable : true,
|
cancelable: options.android ? !!options.android.cancelable : true,
|
||||||
shownCallback: () => this._raiseShownModallyEvent(),
|
shownCallback: () => this._raiseShownModallyEvent(),
|
||||||
@@ -1131,4 +1145,4 @@ createNativePercentLengthProperty({
|
|||||||
createNativePercentLengthProperty({
|
createNativePercentLengthProperty({
|
||||||
setter: "_setMinHeightNative",
|
setter: "_setMinHeightNative",
|
||||||
get setPixels() { return org.nativescript.widgets.ViewHelper.setMinHeight; }
|
get setPixels() { return org.nativescript.widgets.ViewHelper.setMinHeight; }
|
||||||
});
|
});
|
||||||
Reference in New Issue
Block a user