_createNativeView to createNativeView;
_initNativeView to initNativeView
_disposeNativeView to disposeNativeView
_resetNativeView to resetNativeView
This commit is contained in:
Hristo Hristov
2017-03-28 13:05:11 +03:00
parent f2898f84d5
commit c18a76c93a
38 changed files with 111 additions and 110 deletions

View File

@ -68,15 +68,15 @@ class NativeGridLayout extends org.nativescript.widgets.GridLayout {
export class MyButton extends Button implements def.MyButton {
nativeView: NativeButton;
public _createNativeView() {
public createNativeView() {
return new NativeButton(this._context, this);
}
public _initNativeView(): void {
public initNativeView(): void {
this.nativeView.owner = this;
}
public _disposeNativeView() {
public disposeNativeView() {
this.nativeView.owner = undefined;
}
@ -121,15 +121,15 @@ export class MyButton extends Button implements def.MyButton {
export class MyStackLayout extends StackLayout implements def.MyStackLayout {
nativeView: NativeStackLayout;
public _createNativeView() {
public createNativeView() {
return new NativeStackLayout(this._context, this);
}
public _initNativeView(): void {
public initNativeView(): void {
this.nativeView.owner = this;
}
public _disposeNativeView() {
public disposeNativeView() {
this.nativeView.owner = undefined;
}
@ -174,15 +174,15 @@ export class MyStackLayout extends StackLayout implements def.MyStackLayout {
export class MyGridLayout extends GridLayout implements def.MyGridLayout {
nativeView: NativeGridLayout;
public _createNativeView() {
public createNativeView() {
return new NativeGridLayout(this._context, this);
}
public _initNativeView(): void {
public initNativeView(): void {
this.nativeView.owner = this;
}
public _disposeNativeView() {
public disposeNativeView() {
this.nativeView.owner = undefined;
}

View File

@ -281,13 +281,13 @@ class TestView extends Layout {
this.nativeView = undefined;
}
public _createNativeView() {
public createNativeView() {
if (isIOS) {
this.nativeView = this._nativeView;
return this._nativeView;
}
return super._createNativeView();
return super.createNativeView();
}
public toString() {

View File

@ -127,7 +127,7 @@ export class ActionBar extends ActionBarBase {
}
}
public _createNativeView() {
public createNativeView() {
initializeMenuItemClickListener();
const toolbar = new android.support.v7.widget.Toolbar(this._context);
const menuItemClickListener = new MenuItemClickListener(this);
@ -136,11 +136,11 @@ export class ActionBar extends ActionBarBase {
return toolbar;
}
public _initNativeView(): void {
public initNativeView(): void {
(<any>this.nativeView).menuItemClickListener.owner = this;
}
public _disposeNativeView() {
public disposeNativeView() {
(<any>this.nativeView).menuItemClickListener.owner = null;
}

View File

@ -5,7 +5,7 @@ export * from "./activity-indicator-common";
export class ActivityIndicator extends ActivityIndicatorBase {
nativeView: android.widget.ProgressBar;
public _createNativeView() {
public createNativeView() {
const progressBar = new android.widget.ProgressBar(this._context);
progressBar.setVisibility(android.view.View.INVISIBLE);
progressBar.setIndeterminate(true);

View File

@ -41,7 +41,7 @@ export class Button extends ButtonBase {
private _highlightedHandler: (args: TouchGestureEventData) => void;
public _createNativeView() {
public createNativeView() {
initializeClickListener();
const button = new android.widget.Button(this._context);
const clickListener = new ClickListener(this);
@ -50,11 +50,11 @@ export class Button extends ButtonBase {
return button;
}
public _initNativeView(): void {
public initNativeView(): void {
(<any>this.nativeView).clickListener.owner = this;
}
public _disposeNativeView() {
public disposeNativeView() {
(<any>this.nativeView).clickListener.owner = null;
}

View File

@ -202,24 +202,25 @@ export abstract class ViewBase extends Observable {
_tearDownUI(force?: boolean): void;
/**
* Creates a native view
* Creates a native view.
* Returns either android.view.View or UIView.
*/
_createNativeView(): Object;
/**
* Clean up references to the native view.
*/
_disposeNativeView(): void;
createNativeView(): Object;
/**
* Initializes properties/listeners of the native view.
*/
_initNativeView(): void;
initNativeView(): void;
/**
* Clean up references to the native view.
*/
disposeNativeView(): void;
/**
* Resets properties/listeners set to the native view.
*/
_resetNativeView(): void;
resetNativeView(): void;
_isAddedToNativeVisualTree: boolean;

View File

@ -126,7 +126,7 @@ function putNativeView(context: Object, view: ViewBase): void {
list.push(new WeakRef(view.nativeView));
}
export class ViewBase extends Observable implements ViewBaseDefinition {
export abstract class ViewBase extends Observable implements ViewBaseDefinition {
public static loadedEvent = "loaded";
public static unloadedEvent = "unloaded";
@ -588,19 +588,19 @@ export class ViewBase extends Observable implements ViewBaseDefinition {
}
}
public _createNativeView(): Object {
public createNativeView(): Object {
return undefined;
}
public _disposeNativeView() {
public disposeNativeView() {
//
}
public _initNativeView(): void {
public initNativeView(): void {
//
}
public _resetNativeView(): void {
public resetNativeView(): void {
if (this.nativeView && this.recycleNativeView && isAndroid) {
resetNativeView(this);
}
@ -627,7 +627,7 @@ export class ViewBase extends Observable implements ViewBaseDefinition {
}
if (!nativeView) {
nativeView = <android.view.View>this._createNativeView();
nativeView = <android.view.View>this.createNativeView();
}
this._androidView = this.nativeView = nativeView;
@ -659,14 +659,14 @@ export class ViewBase extends Observable implements ViewBaseDefinition {
}
} else {
// TODO: Implement _createNativeView for iOS
this._createNativeView();
this.createNativeView();
if (!currentNativeView) {
console.log(`${this.typeName} doesnt have NativeView !!!!! =================`);
}
// this.nativeView = this._iosView = (<any>this)._nativeView;
}
this._initNativeView();
this.initNativeView();
if (this.parent) {
let nativeIndex = this.parent._childIndexToNativeChildIndex(atIndex);
@ -695,7 +695,7 @@ export class ViewBase extends Observable implements ViewBaseDefinition {
traceWrite(`${this}._tearDownUI(${force})`, traceCategories.VisualTreeEvents);
}
this._resetNativeView();
this.resetNativeView();
this.eachChild((child) => {
child._tearDownUI(force);
@ -714,7 +714,7 @@ export class ViewBase extends Observable implements ViewBaseDefinition {
}
}
this._disposeNativeView();
this.disposeNativeView();
this.nativeView = null;
this._androidView = null;

View File

@ -471,7 +471,7 @@ export class View extends ViewCommon {
export class CustomLayoutView extends View implements CustomLayoutViewDefinition {
nativeView: android.view.ViewGroup;
public _createNativeView() {
public createNativeView() {
return new org.nativescript.widgets.ContentLayout(this._context);
}

View File

@ -53,7 +53,7 @@ function initializeDateChangedListener(): void {
export class DatePicker extends DatePickerBase {
nativeView: android.widget.DatePicker;
public _createNativeView() {
public createNativeView() {
initializeDateChangedListener();
const picker = new android.widget.DatePicker(this._context);
picker.setCalendarViewShown(false);
@ -63,11 +63,11 @@ export class DatePicker extends DatePickerBase {
return picker;
}
public _initNativeView(): void {
public initNativeView(): void {
(<any>this.nativeView).listener.owner = this;
}
public _disposeNativeView() {
public disposeNativeView() {
(<any>this.nativeView).listener.owner = null;
}

View File

@ -136,7 +136,7 @@ export abstract class EditableTextBase extends EditableTextBaseCommon {
public abstract _onReturnPress(): void;
public _createNativeView() {
public createNativeView() {
initializeEditTextListeners();
const editText = new android.widget.EditText(this._context);
this._configureEditText(editText);
@ -149,7 +149,7 @@ export abstract class EditableTextBase extends EditableTextBaseCommon {
return editText;
}
public _initNativeView(): void {
public initNativeView(): void {
const nativeView = this.nativeView;
(<any>nativeView).listener.owner = this;
this._keyListenerCache = nativeView.getKeyListener();
@ -168,12 +168,12 @@ export abstract class EditableTextBase extends EditableTextBaseCommon {
// this._android.removeTextChangedListener(this._editTextListeners);
// }
// }
// super._resetNativeView();
// super.resetNativeView();
// }
// public _disposeNativeView(force?: boolean) {
// this._android = undefined;
// super._disposeNativeView();
// super.disposeNativeView();
// }
public dismissSoftInput() {

View File

@ -289,7 +289,7 @@ export class Frame extends FrameBase {
}
}
public _createNativeView() {
public createNativeView() {
// TODO: probably memory leak.
// this._listener = new android.view.View.OnAttachStateChangeListener({
// onViewAttachedToWindow: this.onNativeViewAttachedToWindow.bind(this),
@ -303,17 +303,17 @@ export class Frame extends FrameBase {
return root;
}
public _initNativeView(): void {
public initNativeView(): void {
this._android.rootViewGroup = this.nativeView;
this._android.rootViewGroup.setId(this._containerViewId);
// this._android.rootViewGroup.addOnAttachStateChangeListener(this._listener);
}
// public _resetNativeView() {
// public resetNativeView() {
// this._android.rootViewGroup.removeOnAttachStateChangeListener(this._listener);
// }
public _disposeNativeView() {
public disposeNativeView() {
// we should keep the reference to underlying native object, since frame can contain many pages.
this._android.rootViewGroup = null;
}

View File

@ -7,7 +7,7 @@ export * from "./html-view-common";
export class HtmlView extends HtmlViewBase {
nativeView: android.widget.TextView;
public _createNativeView() {
public createNativeView() {
const textView = new android.widget.TextView(this._context);
// This makes the html <a href...> work
textView.setLinksClickable(true);

View File

@ -82,7 +82,7 @@ export class Image extends ImageBase {
public decodeHeight = 0;
public useCache = true;
public _createNativeView() {
public createNativeView() {
initializeImageLoadedListener();
if (!imageFetcher) {
initImageCache(this._context);
@ -96,11 +96,11 @@ export class Image extends ImageBase {
return imageView;
}
public _initNativeView(): void {
public initNativeView(): void {
(<any>this.nativeView).listener.owner = this;
}
public _disposeNativeView() {
public disposeNativeView() {
(<any>this.nativeView).listener.owner = null;
}

View File

@ -13,14 +13,14 @@ export class Label extends TextBase implements LabelDefinition {
this.style.whiteSpace = value ? WhiteSpace.NORMAL : WhiteSpace.NO_WRAP;
}
public _createNativeView() {
public createNativeView() {
const textView = new android.widget.TextView(this._context);
textView.setSingleLine(true);
textView.setEllipsize(android.text.TextUtils.TruncateAt.END);
return textView;
}
public _initNativeView(): void {
public initNativeView(): void {
const textView = this.nativeView;
textView.setSingleLine(true);
// textView.setEllipsize(android.text.TextUtils.TruncateAt.END);

View File

@ -19,7 +19,7 @@ View.prototype[leftProperty.setNative] = makeNativeSetter<number>(function(this:
export class AbsoluteLayout extends AbsoluteLayoutBase {
nativeView: org.nativescript.widgets.AbsoluteLayout;
public _createNativeView() {
public createNativeView() {
return new org.nativescript.widgets.AbsoluteLayout(this._context);
}
}

View File

@ -34,7 +34,7 @@ View.prototype[dockProperty.setNative] = function(this: View, value: "left" | "t
export class DockLayout extends DockLayoutBase {
nativeView: org.nativescript.widgets.DockLayout;
public _createNativeView() {
public createNativeView() {
return new org.nativescript.widgets.DockLayout(this._context);
}

View File

@ -79,11 +79,11 @@ const alignSelfMap = {
export class FlexboxLayout extends FlexboxLayoutBase {
nativeView: org.nativescript.widgets.FlexboxLayout;
public _createNativeView() {
public createNativeView() {
return new org.nativescript.widgets.FlexboxLayout(this._context);
}
public _disposeNativeView() {
public disposeNativeView() {
(<any>this.nativeView).invalidateOrdersCache();
}

View File

@ -52,17 +52,17 @@ export class ItemSpec extends ItemSpecBase {
export class GridLayout extends GridLayoutBase {
nativeView: org.nativescript.widgets.GridLayout;
public _createNativeView() {
public createNativeView() {
return new org.nativescript.widgets.GridLayout(this._context);
}
public _initNativeView(): void {
public initNativeView(): void {
// Update native GridLayout
this.rowsInternal.forEach((itemSpec: ItemSpec, index, rows) => { this._onRowAdded(itemSpec); }, this);
this.columnsInternal.forEach((itemSpec: ItemSpec, index, rows) => { this._onColumnAdded(itemSpec); }, this);
}
public _disposeNativeView() {
public disposeNativeView() {
// Update native GridLayout
for (let i = this.rowsInternal.length; i--; i >= 0) {
const itemSpec = <ItemSpec>this.rowsInternal[i];

View File

@ -41,18 +41,18 @@ export class Layout extends LayoutBase implements LayoutDefinition {
_measuredWidth: number;
_measuredHeight: number;
public _createNativeView() {
public createNativeView() {
initializeNativeViewGroup();
return new NativeViewGroup(this._context);
}
public _initNativeView(): void {
public initNativeView(): void {
(<any>this.nativeView)[OWNER] = this;
}
public _disposeNativeView() {
public disposeNativeView() {
(<any>this.nativeView)[OWNER] = undefined;
super._disposeNativeView();
super.disposeNativeView();
}
public measure(widthMeasureSpec: number, heightMeasureSpec: number): void {

View File

@ -5,7 +5,7 @@ export * from "./stack-layout-common";
export class StackLayout extends StackLayoutBase {
nativeView: org.nativescript.widgets.StackLayout;
public _createNativeView() {
public createNativeView() {
return new org.nativescript.widgets.StackLayout(this._context);
}

View File

@ -5,7 +5,7 @@ export * from "./wrap-layout-common";
export class WrapLayout extends WrapLayoutBase {
nativeView: org.nativescript.widgets.WrapLayout;
public _createNativeView() {
public createNativeView() {
return new org.nativescript.widgets.WrapLayout(this._context);
}

View File

@ -72,7 +72,7 @@ export class ListPicker extends ListPickerBase {
nativeView: android.widget.NumberPicker;
private _selectorWheelPaint: android.graphics.Paint;
public _createNativeView() {
public createNativeView() {
initializeNativeClasses();
const picker = new android.widget.NumberPicker(this._context);
@ -98,7 +98,7 @@ export class ListPicker extends ListPickerBase {
return picker;
}
public _initNativeView(): void {
public initNativeView(): void {
const nativeView = this.nativeView;
this._selectorWheelPaint = getSelectorWheelPaint(nativeView);
(<any>nativeView).formatter.owner = this;
@ -115,7 +115,7 @@ export class ListPicker extends ListPickerBase {
}
}
public _disposeNativeView() {
public disposeNativeView() {
const nativeView = this.nativeView;
(<any>nativeView).formatter.owner = null;
(<any>nativeView).valueChangedListener.owner = null;

View File

@ -49,7 +49,7 @@ export class ListView extends ListViewBase {
public _realizedItems = new Map<android.view.View, View>();
public _realizedTemplates = new Map<string, Map<android.view.View, View>>();
public _createNativeView() {
public createNativeView() {
initializeItemClickListener();
const listView = new android.widget.ListView(this._context);
@ -73,7 +73,7 @@ export class ListView extends ListViewBase {
return listView;
}
public _initNativeView(): void {
public initNativeView(): void {
const nativeView: any = this.nativeView;
(<any>nativeView).itemClickListener.owner = this;
const adapter = (<any>nativeView).adapter;
@ -85,13 +85,13 @@ export class ListView extends ListViewBase {
nativeView.setId(this._androidViewId);
}
public _disposeNativeView() {
public disposeNativeView() {
const nativeView = this.nativeView;
nativeView.setAdapter(null);
(<any>nativeView).itemClickListener.owner = null;
(<any>nativeView).adapter.owner = null;
this.clearRealizedCells();
super._disposeNativeView();
super.disposeNativeView();
}
public refresh() {

View File

@ -90,7 +90,7 @@ export class Page extends PageBase {
nativeView: org.nativescript.widgets.GridLayout;
private _isBackNavigation = false;
public _createNativeView() {
public createNativeView() {
const layout = new org.nativescript.widgets.GridLayout(this._context);
layout.addRow(new org.nativescript.widgets.ItemSpec(1, org.nativescript.widgets.GridUnitType.auto));
layout.addRow(new org.nativescript.widgets.ItemSpec(1, org.nativescript.widgets.GridUnitType.star));
@ -98,7 +98,7 @@ export class Page extends PageBase {
return layout;
}
public _initNativeView(): void {
public initNativeView(): void {
this.nativeView.setBackgroundColor(-1); // White color.
}

View File

@ -4,7 +4,7 @@ import { View } from "../core/view"
export class Placeholder extends View implements PlaceholderDefinition {
public static creatingViewEvent = "creatingView";
public _createNativeView() {
public createNativeView() {
let args = <CreateViewEventData>{ eventName: Placeholder.creatingViewEvent, object: this, view: undefined, context: this._context };
this.notify(args);
return <android.view.View>args.view;

View File

@ -10,7 +10,7 @@ const R_ATTR_PROGRESS_BAR_STYLE_HORIZONTAL = 0x01010078;
export class Progress extends ProgressBase {
nativeView: android.widget.ProgressBar;
public _createNativeView() {
public createNativeView() {
return new android.widget.ProgressBar(this._context, null, R_ATTR_PROGRESS_BAR_STYLE_HORIZONTAL);
}

View File

@ -34,7 +34,7 @@ export class ProxyViewContainer extends LayoutBase implements ProxyViewContainer
return false;
}
public _createNativeView() {
public createNativeView() {
return undefined;
}

View File

@ -70,7 +70,7 @@ export class ScrollView extends ScrollViewBase {
}
}
public _createNativeView() {
public createNativeView() {
const nativeView = this.orientation === "horizontal" ? new org.nativescript.widgets.HorizontalScrollView(this._context) : new org.nativescript.widgets.VerticalScrollView(this._context);
if (this._androidViewId < 0) {
this._androidViewId = android.view.View.generateViewId();

View File

@ -91,7 +91,7 @@ export class SearchBar extends SearchBarBase {
return result;
}
public _createNativeView() {
public createNativeView() {
initializeNativeClasses();
const nativeView = new android.widget.SearchView(this._context);
nativeView.setIconified(false);
@ -107,13 +107,13 @@ export class SearchBar extends SearchBarBase {
return nativeView;
}
public _initNativeView(): void {
public initNativeView(): void {
const nativeView: any = this.nativeView;
nativeView.closeListener.owner = this;
nativeView.queryTextListener.owner = this;
}
public _disposeNativeView() {
public disposeNativeView() {
const nativeView: any = this.nativeView;
nativeView.closeListener.owner = null;
nativeView.queryTextListener.owner = null;

View File

@ -183,7 +183,7 @@ export class SegmentedBar extends SegmentedBarBase {
return !this._addingTab;
}
public _createNativeView() {
public createNativeView() {
initializeNativeClasses();
const context: android.content.Context = this._context;
@ -210,13 +210,13 @@ export class SegmentedBar extends SegmentedBarBase {
return nativeView;
}
public _initNativeView(): void {
public initNativeView(): void {
const nativeView: any = this.nativeView;
nativeView.listener.owner = this;
this._tabContentFactory = this._tabContentFactory || new TabContentFactory(this);
}
public _disposeNativeView() {
public disposeNativeView() {
const nativeView: any = this.nativeView;
nativeView.listener.owner = null;
}

View File

@ -48,7 +48,7 @@ export class Slider extends SliderBase {
_supressNativeValue: boolean;
nativeView: android.widget.SeekBar;
public _createNativeView() {
public createNativeView() {
initializeSeekBarChangeListener();
const listener = new SeekBarChangeListener(this);
const nativeView = new android.widget.SeekBar(this._context);
@ -57,12 +57,12 @@ export class Slider extends SliderBase {
return nativeView;
}
public _initNativeView(): void {
public initNativeView(): void {
const nativeView: any = this.nativeView;
nativeView.listener.owner = this;
}
public _disposeNativeView() {
public disposeNativeView() {
const nativeView: any = this.nativeView;
nativeView.listener.owner = null;
}

View File

@ -35,7 +35,7 @@ export class Switch extends SwitchBase {
nativeView: android.widget.Switch;
public checked: boolean;
public _createNativeView() {
public createNativeView() {
initializeCheckedChangeListener();
const nativeView = new android.widget.Switch(this._context);
const listener = new CheckedChangeListener(this);
@ -44,12 +44,12 @@ export class Switch extends SwitchBase {
return nativeView;
}
public _initNativeView(): void {
public initNativeView(): void {
const nativeView: any = this.nativeView;
nativeView.listener.owner = this;
}
public _disposeNativeView() {
public disposeNativeView() {
const nativeView: any = this.nativeView;
nativeView.listener.owner = null;
}

View File

@ -263,7 +263,7 @@ export class TabView extends TabViewBase {
}
}
public _createNativeView() {
public createNativeView() {
initializeNativeClasses();
if (traceEnabled()) {
traceWrite("TabView._createUI(" + this + ");", traceCategory);
@ -308,7 +308,7 @@ export class TabView extends TabViewBase {
return nativeView;
}
public _initNativeView(): void {
public initNativeView(): void {
if (this._androidViewId < 0) {
this._androidViewId = android.view.View.generateViewId();
}
@ -325,7 +325,7 @@ export class TabView extends TabViewBase {
(<any>this._pagerAdapter).owner = this;
}
public _disposeNativeView() {
public disposeNativeView() {
// this._tabLayout.setItems(null, null);
this._pagerAdapter.notifyDataSetChanged();
(<any>this._pagerAdapter).owner = null;

View File

@ -51,13 +51,13 @@ export class TextBase extends TextBaseCommon {
nativeView: android.widget.TextView;
_defaultTransformationMethod: android.text.method.TransformationMethod;
public _initNativeView(): void {
public initNativeView(): void {
this._defaultTransformationMethod = this.nativeView.getTransformationMethod();
super._initNativeView();
super.initNativeView();
}
public _resetNativeView(): void {
super._resetNativeView();
public resetNativeView(): void {
super.resetNativeView();
// We reset it here too because this could be changed by multiple properties - whiteSpace, secure, textTransform
this.nativeView.setTransformationMethod(this._defaultTransformationMethod);
}

View File

@ -10,9 +10,9 @@ export class TextField extends TextFieldBase {
editText.setHorizontallyScrolling(true);
}
public _initNativeView(): void {
public initNativeView(): void {
// TODO: We should be able to reset it using only our properties. Check it first.
super._initNativeView();
super.initNativeView();
this.nativeView.setInputType(android.text.InputType.TYPE_CLASS_TEXT | android.text.InputType.TYPE_TEXT_VARIATION_NORMAL | android.text.InputType.TYPE_TEXT_FLAG_CAP_SENTENCES);
}

View File

@ -9,9 +9,9 @@ export class TextView extends EditableTextBase implements TextViewDefinition {
editText.setGravity(android.view.Gravity.TOP | android.view.Gravity.LEFT);
}
public _initNativeView(): void {
public initNativeView(): void {
// TODO: We should be able to reset it using only our properties. Check it first.
super._initNativeView();
super.initNativeView();
this.nativeView.setInputType(android.text.InputType.TYPE_CLASS_TEXT | android.text.InputType.TYPE_TEXT_VARIATION_NORMAL | android.text.InputType.TYPE_TEXT_FLAG_CAP_SENTENCES | android.text.InputType.TYPE_TEXT_FLAG_MULTI_LINE);
}
}

View File

@ -44,7 +44,7 @@ export class TimePicker extends TimePickerBase {
nativeView: android.widget.TimePicker;
updatingNativeValue: boolean;
public _createNativeView() {
public createNativeView() {
initializeTimeChangedListener();
const nativeView = new android.widget.TimePicker(this._context);
const listener = new TimeChangedListener(this);
@ -54,7 +54,7 @@ export class TimePicker extends TimePickerBase {
return nativeView;
}
public _initNativeView(): void {
public initNativeView(): void {
const nativeView: any = this.nativeView;
nativeView.listener.owner = this;

View File

@ -88,7 +88,7 @@ function initializeWebViewClient(): void {
export class WebView extends WebViewBase {
nativeView: android.webkit.WebView;
public _createNativeView() {
public createNativeView() {
initializeWebViewClient();
const nativeView = new android.webkit.WebView(this._context);
@ -100,18 +100,18 @@ export class WebView extends WebViewBase {
return nativeView;
}
public _initNativeView(): void {
public initNativeView(): void {
(<any>this.nativeView).client.owner = this;
}
public _resetNativeView() {
public resetNativeView() {
const nativeView = this.nativeView;
if (nativeView) {
nativeView.destroy();
}
(<any>nativeView).client.owner = null;
super._resetNativeView();
super.resetNativeView();
}
public _loadFileOrResource(path: string, content: string) {