Files
NativeScript/ui/button/button.android.ts
Hristo Deshev 9fbcf5f143 Fix typescript 1.6 compile errors.
- Remove unknown properties in object literals.
- Don't use module-level `delete` statements.
2015-09-18 11:20:17 +03:00

43 lines
944 B
TypeScript

import common = require("ui/button/button-common");
global.moduleMerge(common, exports);
interface Owned {
owner: any;
}
export class Button extends common.Button {
private _android: android.widget.Button;
private _isPressed: boolean;
constructor() {
super();
this._isPressed = false;
}
get android(): android.widget.Button {
return this._android;
}
public _createUI() {
var that = new WeakRef(this);
this._android = new android.widget.Button(this._context);
this._android.setOnClickListener(new android.view.View.OnClickListener(
<Owned & android.view.View.IOnClickListener>{
get owner() {
return that.get();
},
onClick: function (v) {
if (this.owner) {
this.owner._emit(common.Button.tapEvent);
}
}
}));
}
}