refactor(core-modules): implement createNativeView and initNativeView for all components

refactor(core-modules): implement createNativeView and initNativeView for all components
This commit is contained in:
Martin Guillon
2018-09-26 12:59:12 +02:00
committed by Martin Yankov
parent 71107533bb
commit 46705ee332
48 changed files with 632 additions and 521 deletions

View File

@ -36,18 +36,16 @@ export class Switch extends SwitchBase {
public checked: boolean;
public createNativeView() {
initializeCheckedChangeListener();
const nativeView = new android.widget.Switch(this._context);
const listener = new CheckedChangeListener(this);
nativeView.setOnCheckedChangeListener(listener);
(<any>nativeView).listener = listener;
return nativeView;
return new android.widget.Switch(this._context);
}
public initNativeView(): void {
super.initNativeView();
const nativeView: any = this.nativeViewProtected;
nativeView.listener.owner = this;
const nativeView = this.nativeViewProtected;
initializeCheckedChangeListener();
const listener = new CheckedChangeListener(this);
nativeView.setOnCheckedChangeListener(listener);
(<any>nativeView).listener = listener;
}
public disposeNativeView() {