chore: cleanup

This commit is contained in:
Nathan Walker
2020-07-06 23:27:18 -07:00
parent 49cd2f0df3
commit c6902538cf
62 changed files with 328 additions and 182 deletions

View File

@@ -385,7 +385,7 @@ export abstract class ViewBase extends Observable implements ViewBaseDefinition
this[name] = WrappedValue.unwrap(value);
}
@profile()
@profile
public onLoaded() {
this.setFlag(Flags.superOnLoadedCalled, true);
if (this._isLoaded) {
@@ -405,7 +405,7 @@ export abstract class ViewBase extends Observable implements ViewBaseDefinition
this._emit('loaded');
}
@profile()
@profile
public onUnloaded() {
this.setFlag(Flags.superOnUnloadedCalled, true);
if (!this._isLoaded) {
@@ -524,7 +524,7 @@ export abstract class ViewBase extends Observable implements ViewBaseDefinition
return allStates;
}
@profile()
@profile
public addPseudoClass(name: string): void {
let allStates = this.getAllAliasedStates(name);
for (let i = 0; i < allStates.length; i++) {
@@ -535,7 +535,7 @@ export abstract class ViewBase extends Observable implements ViewBaseDefinition
}
}
@profile()
@profile
public deletePseudoClass(name: string): void {
let allStates = this.getAllAliasedStates(name);
for (let i = 0; i < allStates.length; i++) {
@@ -618,7 +618,7 @@ export abstract class ViewBase extends Observable implements ViewBaseDefinition
}
}
@profile()
@profile
public requestLayout(): void {
// Default implementation for non View instances (like TabViewItem).
const parent = this.parent;
@@ -631,7 +631,7 @@ export abstract class ViewBase extends Observable implements ViewBaseDefinition
//
}
@profile()
@profile
public _addView(view: ViewBase, atIndex?: number) {
if (Trace.isEnabled()) {
Trace.write(`${this}._addView(${view}, ${atIndex})`, Trace.categories.ViewHierarchy);
@@ -757,7 +757,7 @@ export abstract class ViewBase extends Observable implements ViewBaseDefinition
this._setupUI(context);
}
@profile()
@profile
public _setupUI(context: android.content.Context, atIndex?: number, parentIsLoaded?: boolean): void {
if (this._context === context) {
return;
@@ -851,7 +851,7 @@ export abstract class ViewBase extends Observable implements ViewBaseDefinition
}
}
@profile()
@profile
public _tearDownUI(force?: boolean): void {
// No context means we are already teared down.
if (!this._context) {

View File

@@ -46,7 +46,7 @@ import { profile } from '../../../profiling';
import { topmost } from '../../frame/frame-stack';
import { screen } from '../../../platform';
import { AndroidActivityBackPressedEventData, android as androidApp } from '../../../application';
import { device } from '../../../platform';
import { Device } from '../../../platform';
import lazy from '../../../utils/lazy';
export * from './view-common';
@@ -59,7 +59,7 @@ const statePressed = 16842919; // android.R.attr.state_pressed
const stateEnabled = 16842910; // android.R.attr.state_enabled
const styleAnimationDialog = 16973826; // android.R.style.Animation_Dialog
const sdkVersion = lazy(() => parseInt(device.sdkVersion));
const sdkVersion = lazy(() => parseInt(Device.sdkVersion));
const modalMap = new Map<number, DialogOptions>();
@@ -389,7 +389,7 @@ export class View extends ViewCommon {
return manager;
}
@profile()
@profile
public onLoaded() {
this._manager = null;
this._rootManager = null;
@@ -397,7 +397,7 @@ export class View extends ViewCommon {
this.setOnTouchListener();
}
@profile()
@profile
public onUnloaded() {
if (this.touchListenerIsSet) {
this.touchListenerIsSet = false;
@@ -516,7 +516,7 @@ export class View extends ViewCommon {
}
}
@profile()
@profile
public requestLayout(): void {
super.requestLayout();
if (this.nativeViewProtected) {

View File

@@ -80,7 +80,7 @@ export class View extends ViewCommon implements ViewDefinition {
}
}
@profile()
@profile
public layout(left: number, top: number, right: number, bottom: number, setFrame = true): void {
const { boundsChanged, sizeChanged } = this._setCurrentLayoutBounds(left, top, right, bottom);
if (setFrame) {
@@ -118,7 +118,7 @@ export class View extends ViewCommon implements ViewDefinition {
this._privateFlags |= PFLAG_MEASURED_DIMENSION_SET;
}
@profile()
@profile
public onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void {
const view = this.nativeViewProtected;
const width = layout.getMeasureSpecSize(widthMeasureSpec);