view property added and implemented for android

This commit is contained in:
Vladimir Enchev
2014-06-06 11:29:11 +03:00
parent 1a4e911bc1
commit 14dd0b799a
3 changed files with 15 additions and 1 deletions

2
ui/core/view.d.ts vendored
View File

@ -2,4 +2,6 @@
export declare class View extends proxy.ProxyObject {
addToParent: (parent: any) => void;
android: any;
ios: any;
}

View File

@ -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();
}

View File

@ -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;
}
}