mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
view property added and implemented for android
This commit is contained in:
2
ui/core/view.d.ts
vendored
2
ui/core/view.d.ts
vendored
@ -2,4 +2,6 @@
|
||||
|
||||
export declare class View extends proxy.ProxyObject {
|
||||
addToParent: (parent: any) => void;
|
||||
android: any;
|
||||
ios: any;
|
||||
}
|
@ -4,6 +4,7 @@
|
||||
import promises = require("promises");
|
||||
import dialogs = require("ui/dialogs");
|
||||
import appmodule = require("application");
|
||||
import view = require("ui/core/view");
|
||||
|
||||
var STRING = "string",
|
||||
ALERT = "Alert",
|
||||
@ -104,6 +105,7 @@ export class Dialog {
|
||||
private _dialog: android.app.AlertDialog;
|
||||
private _android: android.app.AlertDialog.Builder;
|
||||
private _title: string;
|
||||
private _view: view.View;
|
||||
|
||||
constructor() {
|
||||
this._android = new android.app.AlertDialog.Builder(appmodule.android.foregroundActivity);
|
||||
@ -121,6 +123,14 @@ export class Dialog {
|
||||
this.android.setTitle(this._title);
|
||||
}
|
||||
|
||||
get view(): view.View {
|
||||
return this._view;
|
||||
}
|
||||
set view(value: view.View) {
|
||||
this._view = value;
|
||||
this.android.setView(this._view.android);
|
||||
}
|
||||
|
||||
public show() {
|
||||
this._dialog = this.android.show();
|
||||
}
|
||||
|
4
ui/dialogs/dialogs.d.ts
vendored
4
ui/dialogs/dialogs.d.ts
vendored
@ -1,5 +1,7 @@
|
||||
declare module "ui/dialogs" {
|
||||
import promises = require("promises");
|
||||
import view = require("ui/core/view");
|
||||
|
||||
/**
|
||||
* The alert() method displays an alert box with a specified message.
|
||||
* @param message Specifies the text to display in the alert box.
|
||||
@ -105,6 +107,6 @@
|
||||
/**
|
||||
* Gets or sets dialog view.
|
||||
*/
|
||||
view: any;
|
||||
view: view.View;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user