mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 03:31:45 +08:00
Renamed closeDialog to closeModal; as we do a showModal; for consistency.
Fixed page auto sizing full on Android.
This commit is contained in:

committed by
Rossen Hristov

parent
5d3d772462
commit
7366e546dc
@ -33,9 +33,10 @@ export class Page extends contentView.ContentView implements dts.Page {
|
||||
public static navigatedFromEvent = "navigatedFrom";
|
||||
public static shownModallyEvent = "shownModally";
|
||||
|
||||
protected _closeModalCallback: Function;
|
||||
|
||||
private _navigationContext: any;
|
||||
|
||||
private _closeDialogCallback: Function;
|
||||
private _cssApplied: boolean;
|
||||
private _styleScope: styleScope.StyleScope = new styleScope.StyleScope();
|
||||
private _actionBar: actionBar.ActionBar;
|
||||
@ -190,9 +191,9 @@ export class Page extends contentView.ContentView implements dts.Page {
|
||||
(<Page>page)._showNativeModalView(this, context, closeCallback, fullscreen);
|
||||
}
|
||||
|
||||
public closeDialog() {
|
||||
if (this._closeDialogCallback) {
|
||||
this._closeDialogCallback.apply(undefined, arguments);
|
||||
public closeModal() {
|
||||
if (this._closeModalCallback) {
|
||||
this._closeModalCallback.apply(undefined, arguments);
|
||||
}
|
||||
}
|
||||
|
||||
@ -207,9 +208,9 @@ export class Page extends contentView.ContentView implements dts.Page {
|
||||
|
||||
protected _showNativeModalView(parent: Page, context: any, closeCallback: Function, fullscreen?: boolean) {
|
||||
var that = this;
|
||||
this._closeDialogCallback = function () {
|
||||
if (that._closeDialogCallback) {
|
||||
that._closeDialogCallback = null;
|
||||
this._closeModalCallback = function () {
|
||||
if (that._closeModalCallback) {
|
||||
that._closeModalCallback = null;
|
||||
that._hideNativeModalView(parent);
|
||||
if (typeof closeCallback === "function") {
|
||||
closeCallback.apply(undefined, arguments);
|
||||
@ -227,7 +228,7 @@ export class Page extends contentView.ContentView implements dts.Page {
|
||||
eventName: Page.shownModallyEvent,
|
||||
object: this,
|
||||
context: context,
|
||||
closeCallback: this._closeDialogCallback
|
||||
closeCallback: this._closeModalCallback
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,11 @@ export class Page extends pageCommon.Page {
|
||||
public _createUI() {
|
||||
this._grid = new org.nativescript.widgets.GridLayout(this._context);
|
||||
this._grid.addRow(new org.nativescript.widgets.ItemSpec(1, org.nativescript.widgets.GridUnitType.auto));
|
||||
this._grid.addRow(new org.nativescript.widgets.ItemSpec(1, org.nativescript.widgets.GridUnitType.star));
|
||||
var gridUnitType = org.nativescript.widgets.GridUnitType.star
|
||||
if (this._closeModalCallback) {
|
||||
gridUnitType = org.nativescript.widgets.GridUnitType.auto;
|
||||
}
|
||||
this._grid.addRow(new org.nativescript.widgets.ItemSpec(1, gridUnitType));
|
||||
}
|
||||
|
||||
public _addViewToNativeVisualTree(child: view.View, atIndex?: number): boolean {
|
||||
@ -116,7 +120,7 @@ export class Page extends pageCommon.Page {
|
||||
|
||||
var that = this;
|
||||
this._dialogFragment = new DialogFragmentClass(this, fullscreen, function() {
|
||||
that.closeDialog();
|
||||
that.closeModal();
|
||||
});
|
||||
this._dialogFragment.show(parent.frame.android.activity.getFragmentManager(), "dialog");
|
||||
|
||||
|
Reference in New Issue
Block a user