mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
chore: cleanup
This commit is contained in:
@@ -305,7 +305,7 @@ export class ActionItemBase extends ViewBase implements ActionItemDefinition {
|
||||
}
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public onLoaded() {
|
||||
if (this._actionView) {
|
||||
this._actionView.style[horizontalAlignmentProperty.cssName] = 'center';
|
||||
|
||||
@@ -8,7 +8,7 @@ import { Color } from '../../color';
|
||||
import { Trace } from '../../trace';
|
||||
import { opacityProperty, backgroundColorProperty, rotateProperty, rotateXProperty, rotateYProperty, translateXProperty, translateYProperty, scaleXProperty, scaleYProperty, heightProperty, widthProperty, PercentLength } from '../styling/style-properties';
|
||||
import { layout } from '../../utils';
|
||||
import { device, screen } from '../../platform';
|
||||
import { Device, screen } from '../../platform';
|
||||
import lazy from '../../utils/lazy';
|
||||
|
||||
export * from './animation-common';
|
||||
@@ -219,7 +219,7 @@ export class Animation extends AnimationBase {
|
||||
private _play(): AnimationPromise {
|
||||
const animationFinishedPromise = super.play();
|
||||
|
||||
if (device.sdkVersion <= '23') {
|
||||
if (Device.sdkVersion <= '23') {
|
||||
this._animatorSet = new android.animation.AnimatorSet();
|
||||
this._animatorSet.addListener(this._animatorListener);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import { TextTransform } from '../text-base';
|
||||
// Requires
|
||||
import { Color } from '../../color';
|
||||
import { ImageSource } from '../../image-source';
|
||||
import { device } from '../../platform';
|
||||
import { Device } from '../../platform';
|
||||
import { ios as iosUtils, isFontIconURI, layout } from '../../utils';
|
||||
import { CSSType, ios as iosView, View } from '../core/view';
|
||||
import { Frame } from '../frame';
|
||||
@@ -20,7 +20,7 @@ import { getTransformedText } from '../text-base';
|
||||
|
||||
const maxTabsCount = 5;
|
||||
const majorVersion = iosUtils.MajorVersion;
|
||||
const isPhone = device.deviceType === 'Phone';
|
||||
const isPhone = Device.deviceType === 'Phone';
|
||||
|
||||
class UITabBarControllerImpl extends UITabBarController {
|
||||
private _owner: WeakRef<BottomNavigation>;
|
||||
|
||||
@@ -7,7 +7,7 @@ import { isEventOrGesture } from '../../core/bindable';
|
||||
import { getBindingOptions, bindingConstants } from '../binding-builder';
|
||||
import { profile } from '../../../profiling';
|
||||
import * as debugModule from '../../../utils/debug';
|
||||
import * as platform from '../../../platform';
|
||||
import { Device } from '../../../platform';
|
||||
import { sanitizeModuleName } from '../module-name-sanitizer';
|
||||
import { resolveModuleName } from '../../../module-name-resolver';
|
||||
|
||||
@@ -115,7 +115,7 @@ const applyComponentAttributes = profile('applyComponentAttributes', (instance:
|
||||
if (attr.indexOf(':') !== -1) {
|
||||
const platformName = attr.split(':')[0].trim();
|
||||
|
||||
if (platformName.toLowerCase() === platform.device.os.toLowerCase()) {
|
||||
if (platformName.toLowerCase() === Device.os.toLowerCase()) {
|
||||
attr = attr.split(':')[1].trim();
|
||||
} else {
|
||||
continue;
|
||||
|
||||
@@ -9,7 +9,7 @@ import { debug, ScopeError, SourceError, Source } from '../../utils/debug';
|
||||
import * as xml from '../../xml';
|
||||
import { isString, isObject, isDefined } from '../../utils/types';
|
||||
import { ComponentModule, setPropertyValue, getComponentModule } from './component-builder';
|
||||
import { platformNames, device } from '../../platform';
|
||||
import { platformNames, Device } from '../../platform';
|
||||
import { profile } from '../../profiling';
|
||||
import { sanitizeModuleName } from './module-name-sanitizer';
|
||||
import { resolveModuleName } from '../../module-name-resolver';
|
||||
@@ -368,7 +368,7 @@ namespace xml2ui {
|
||||
}
|
||||
|
||||
private static isCurentPlatform(value: string): boolean {
|
||||
return value && value.toLowerCase() === device.os.toLowerCase();
|
||||
return value && value.toLowerCase() === Device.os.toLowerCase();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -579,7 +579,7 @@ namespace xml2ui {
|
||||
this.sourceTracker = sourceTracker;
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
private buildComponent(args: xml.ParserEvent): ComponentModule {
|
||||
if (args.prefix && args.namespace) {
|
||||
// Custom components
|
||||
|
||||
@@ -5,12 +5,12 @@ import { textAlignmentProperty } from '../text-base';
|
||||
import { TextAlignment } from '../enums';
|
||||
import { profile } from '../../profiling';
|
||||
import { TouchGestureEventData, GestureTypes, TouchAction } from '../gestures';
|
||||
import { device } from '../../platform';
|
||||
import { Device } from '../../platform';
|
||||
import lazy from '../../utils/lazy';
|
||||
|
||||
export * from './button-common';
|
||||
|
||||
const sdkVersion = lazy(() => parseInt(device.sdkVersion));
|
||||
const sdkVersion = lazy(() => parseInt(Device.sdkVersion));
|
||||
|
||||
interface ClickListener {
|
||||
new (owner: Button): android.view.View.OnClickListener;
|
||||
@@ -57,7 +57,7 @@ export class Button extends ButtonBase {
|
||||
private _stateListAnimator: any;
|
||||
private _highlightedHandler: (args: TouchGestureEventData) => void;
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public createNativeView() {
|
||||
if (!AndroidButton) {
|
||||
AndroidButton = android.widget.Button;
|
||||
|
||||
@@ -6,7 +6,7 @@ import { textAlignmentProperty, whiteSpaceProperty, WhiteSpace } from '../text-b
|
||||
import { TextAlignment } from '../enums';
|
||||
import { profile } from '../../profiling';
|
||||
import { TouchGestureEventData, GestureTypes, TouchAction } from '../gestures';
|
||||
import { device } from '../../platform';
|
||||
import { Device } from '../../platform';
|
||||
import { layout } from '../../utils';
|
||||
|
||||
export * from './button-common';
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -110,7 +110,7 @@ export class FrameBase extends CustomLayoutView implements FrameDefinition {
|
||||
throw new Error(`Frame should not have a view. Use 'defaultPage' property instead.`);
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public onLoaded() {
|
||||
super.onLoaded();
|
||||
|
||||
@@ -378,7 +378,7 @@ export class FrameBase extends CustomLayoutView implements FrameDefinition {
|
||||
}
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public performNavigation(navigationContext: NavigationContext) {
|
||||
this._executingContext = navigationContext;
|
||||
|
||||
@@ -388,7 +388,7 @@ export class FrameBase extends CustomLayoutView implements FrameDefinition {
|
||||
this._navigateCore(backstackEntry);
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
private performGoBack(navigationContext: NavigationContext) {
|
||||
let backstackEntry = navigationContext.entry;
|
||||
const backstack = this._backStack;
|
||||
|
||||
@@ -17,7 +17,7 @@ import { _setAndroidFragmentTransitions, _getAnimatedEntries, _updateTransitions
|
||||
// TODO: Remove this and get it from global to decouple builder for angular
|
||||
import { Builder } from '../builder';
|
||||
import { CLASS_PREFIX, getSystemCssClasses, pushToSystemCssClasses, ROOT_VIEW_CSS_CLASS } from '../../css/system-classes';
|
||||
import { device } from '../../platform';
|
||||
import { Device } from '../../platform';
|
||||
import { profile } from '../../profiling';
|
||||
|
||||
export * from './frame-common';
|
||||
@@ -370,7 +370,7 @@ export class Frame extends FrameBase {
|
||||
|
||||
// HACK: This @profile decorator creates a circular dependency
|
||||
// HACK: because the function parameter type is evaluated with 'typeof'
|
||||
@profile()
|
||||
@profile
|
||||
public _navigateCore(newEntry: any) {
|
||||
// should be (newEntry: BackstackEntry)
|
||||
super._navigateCore(newEntry);
|
||||
@@ -818,7 +818,7 @@ class FragmentCallbacksImplementation implements AndroidFragmentCallbacks {
|
||||
public entry: BackstackEntry;
|
||||
private backgroundBitmap: android.graphics.Bitmap = null;
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public onHiddenChanged(fragment: androidx.fragment.app.Fragment, hidden: boolean, superFunc: Function): void {
|
||||
if (Trace.isEnabled()) {
|
||||
Trace.write(`${fragment}.onHiddenChanged(${hidden})`, Trace.categories.NativeLifecycle);
|
||||
@@ -826,7 +826,7 @@ class FragmentCallbacksImplementation implements AndroidFragmentCallbacks {
|
||||
superFunc.call(fragment, hidden);
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public onCreateAnimator(fragment: androidx.fragment.app.Fragment, transit: number, enter: boolean, nextAnim: number, superFunc: Function): android.animation.Animator {
|
||||
let animator = null;
|
||||
const entry = <any>this.entry;
|
||||
@@ -840,7 +840,7 @@ class FragmentCallbacksImplementation implements AndroidFragmentCallbacks {
|
||||
return animator || superFunc.call(fragment, transit, enter, nextAnim);
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public onCreate(fragment: androidx.fragment.app.Fragment, savedInstanceState: android.os.Bundle, superFunc: Function): void {
|
||||
if (Trace.isEnabled()) {
|
||||
Trace.write(`${fragment}.onCreate(${savedInstanceState})`, Trace.categories.NativeLifecycle);
|
||||
@@ -861,7 +861,7 @@ class FragmentCallbacksImplementation implements AndroidFragmentCallbacks {
|
||||
}
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public onCreateView(fragment: androidx.fragment.app.Fragment, inflater: android.view.LayoutInflater, container: android.view.ViewGroup, savedInstanceState: android.os.Bundle, superFunc: Function): android.view.View {
|
||||
if (Trace.isEnabled()) {
|
||||
Trace.write(`${fragment}.onCreateView(inflater, container, ${savedInstanceState})`, Trace.categories.NativeLifecycle);
|
||||
@@ -935,7 +935,7 @@ class FragmentCallbacksImplementation implements AndroidFragmentCallbacks {
|
||||
return page.nativeViewProtected;
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public onSaveInstanceState(fragment: androidx.fragment.app.Fragment, outState: android.os.Bundle, superFunc: Function): void {
|
||||
if (Trace.isEnabled()) {
|
||||
Trace.write(`${fragment}.onSaveInstanceState(${outState})`, Trace.categories.NativeLifecycle);
|
||||
@@ -943,7 +943,7 @@ class FragmentCallbacksImplementation implements AndroidFragmentCallbacks {
|
||||
superFunc.call(fragment, outState);
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public onDestroyView(fragment: org.nativescript.widgets.FragmentBase, superFunc: Function): void {
|
||||
try {
|
||||
if (Trace.isEnabled()) {
|
||||
@@ -963,7 +963,7 @@ class FragmentCallbacksImplementation implements AndroidFragmentCallbacks {
|
||||
}
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public onDestroy(fragment: androidx.fragment.app.Fragment, superFunc: Function): void {
|
||||
if (Trace.isEnabled()) {
|
||||
Trace.write(`${fragment}.onDestroy()`, Trace.categories.NativeLifecycle);
|
||||
@@ -992,7 +992,7 @@ class FragmentCallbacksImplementation implements AndroidFragmentCallbacks {
|
||||
}
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public onPause(fragment: org.nativescript.widgets.FragmentBase, superFunc: Function): void {
|
||||
try {
|
||||
// Get view as bitmap and set it as background. This is workaround for the disapearing nested fragments.
|
||||
@@ -1007,12 +1007,12 @@ class FragmentCallbacksImplementation implements AndroidFragmentCallbacks {
|
||||
}
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public onStop(fragment: androidx.fragment.app.Fragment, superFunc: Function): void {
|
||||
superFunc.call(fragment);
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public toStringOverride(fragment: androidx.fragment.app.Fragment, superFunc: Function): string {
|
||||
const entry = this.entry;
|
||||
if (entry) {
|
||||
@@ -1053,7 +1053,7 @@ class ActivityCallbacksImplementation implements AndroidActivityCallbacks {
|
||||
return this._rootView;
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public onCreate(activity: androidx.appcompat.app.AppCompatActivity, savedInstanceState: android.os.Bundle, intentOrSuperFunc: android.content.Intent | Function, superFunc?: Function): void {
|
||||
if (Trace.isEnabled()) {
|
||||
Trace.write(`Activity.onCreate(${savedInstanceState})`, Trace.categories.NativeLifecycle);
|
||||
@@ -1096,7 +1096,7 @@ class ActivityCallbacksImplementation implements AndroidActivityCallbacks {
|
||||
moduleLoaded = true;
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public onSaveInstanceState(activity: androidx.appcompat.app.AppCompatActivity, outState: android.os.Bundle, superFunc: Function): void {
|
||||
superFunc.call(activity, outState);
|
||||
const rootView = this._rootView;
|
||||
@@ -1108,7 +1108,7 @@ class ActivityCallbacksImplementation implements AndroidActivityCallbacks {
|
||||
outState.putInt(ROOT_VIEW_ID_EXTRA, rootView._domId);
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public onNewIntent(activity: androidx.appcompat.app.AppCompatActivity, intent: android.content.Intent, superSetIntentFunc: Function, superFunc: Function): void {
|
||||
superFunc.call(activity, intent);
|
||||
superSetIntentFunc.call(activity, intent);
|
||||
@@ -1121,7 +1121,7 @@ class ActivityCallbacksImplementation implements AndroidActivityCallbacks {
|
||||
});
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public onStart(activity: any, superFunc: Function): void {
|
||||
superFunc.call(activity);
|
||||
|
||||
@@ -1135,7 +1135,7 @@ class ActivityCallbacksImplementation implements AndroidActivityCallbacks {
|
||||
}
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public onStop(activity: any, superFunc: Function): void {
|
||||
superFunc.call(activity);
|
||||
|
||||
@@ -1149,7 +1149,7 @@ class ActivityCallbacksImplementation implements AndroidActivityCallbacks {
|
||||
}
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public onPostResume(activity: any, superFunc: Function): void {
|
||||
superFunc.call(activity);
|
||||
|
||||
@@ -1173,7 +1173,7 @@ class ActivityCallbacksImplementation implements AndroidActivityCallbacks {
|
||||
}
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public onDestroy(activity: any, superFunc: Function): void {
|
||||
try {
|
||||
if (Trace.isEnabled()) {
|
||||
@@ -1196,7 +1196,7 @@ class ActivityCallbacksImplementation implements AndroidActivityCallbacks {
|
||||
}
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public onBackPressed(activity: any, superFunc: Function): void {
|
||||
if (Trace.isEnabled()) {
|
||||
Trace.write('NativeScriptActivity.onBackPressed;', Trace.categories.NativeLifecycle);
|
||||
@@ -1234,7 +1234,7 @@ class ActivityCallbacksImplementation implements AndroidActivityCallbacks {
|
||||
}
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public onRequestPermissionsResult(activity: any, requestCode: number, permissions: Array<String>, grantResults: Array<number>, superFunc: Function): void {
|
||||
if (Trace.isEnabled()) {
|
||||
Trace.write('NativeScriptActivity.onRequestPermissionsResult;', Trace.categories.NativeLifecycle);
|
||||
@@ -1250,7 +1250,7 @@ class ActivityCallbacksImplementation implements AndroidActivityCallbacks {
|
||||
});
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public onActivityResult(activity: any, requestCode: number, resultCode: number, data: android.content.Intent, superFunc: Function): void {
|
||||
superFunc.call(activity, requestCode, resultCode, data);
|
||||
if (Trace.isEnabled()) {
|
||||
@@ -1314,7 +1314,7 @@ class ActivityCallbacksImplementation implements AndroidActivityCallbacks {
|
||||
this._rootView = rootView;
|
||||
activityRootViewsMap.set(rootView._domId, new WeakRef(rootView));
|
||||
|
||||
const deviceType = device.deviceType.toLowerCase();
|
||||
const deviceType = Device.deviceType.toLowerCase();
|
||||
|
||||
pushToSystemCssClasses(`${CLASS_PREFIX}${ANDROID_PLATFORM}`);
|
||||
pushToSystemCssClasses(`${CLASS_PREFIX}${deviceType}`);
|
||||
|
||||
@@ -62,7 +62,7 @@ export class Frame extends FrameBase {
|
||||
|
||||
// !!! THIS PROFILE DECORATOR CREATES A CIRCULAR DEPENDENCY
|
||||
// !!! BECAUSE THE PARAMETER TYPE IS EVALUATED WITH TYPEOF
|
||||
@profile()
|
||||
@profile
|
||||
public _navigateCore(backstackEntry: any) {
|
||||
super._navigateCore(backstackEntry);
|
||||
|
||||
@@ -396,7 +396,7 @@ class UINavigationControllerImpl extends UINavigationController {
|
||||
return this._owner.get();
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public viewWillAppear(animated: boolean): void {
|
||||
super.viewWillAppear(animated);
|
||||
const owner = this._owner.get();
|
||||
@@ -405,7 +405,7 @@ class UINavigationControllerImpl extends UINavigationController {
|
||||
}
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public viewDidDisappear(animated: boolean): void {
|
||||
super.viewDidDisappear(animated);
|
||||
const owner = this._owner.get();
|
||||
@@ -439,7 +439,7 @@ class UINavigationControllerImpl extends UINavigationController {
|
||||
});
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public pushViewControllerAnimated(viewController: UIViewController, animated: boolean): void {
|
||||
let navigationTransition = <NavigationTransition>viewController[TRANSITION];
|
||||
if (Trace.isEnabled()) {
|
||||
@@ -458,7 +458,7 @@ class UINavigationControllerImpl extends UINavigationController {
|
||||
});
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public setViewControllersAnimated(viewControllers: NSArray<any>, animated: boolean): void {
|
||||
let viewController = viewControllers.lastObject;
|
||||
let navigationTransition = <NavigationTransition>viewController[TRANSITION];
|
||||
|
||||
@@ -24,7 +24,7 @@ export class Label extends TextBase implements LabelDefinition {
|
||||
this.style.whiteSpace = value ? 'normal' : 'nowrap';
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public createNativeView() {
|
||||
if (!TextView) {
|
||||
TextView = android.widget.TextView;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { ListPickerBase, selectedIndexProperty, itemsProperty, ItemsSource } from './list-picker-common';
|
||||
import { colorProperty } from '../styling/style-properties';
|
||||
import { Color } from '../../color';
|
||||
import { device } from '../../platform';
|
||||
import { Device } from '../../platform';
|
||||
import lazy from '../../utils/lazy';
|
||||
|
||||
export * from './list-picker-common';
|
||||
|
||||
const sdkVersion = lazy(() => parseInt(device.sdkVersion));
|
||||
const sdkVersion = lazy(() => parseInt(Device.sdkVersion));
|
||||
|
||||
interface Formatter {
|
||||
new (owner: ListPicker): android.widget.NumberPicker.Formatter;
|
||||
|
||||
@@ -32,7 +32,7 @@ export class ListPicker extends ListPickerBase {
|
||||
return this.nativeViewProtected;
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public onLoaded() {
|
||||
super.onLoaded();
|
||||
this.ios.delegate = this._delegate;
|
||||
|
||||
@@ -57,7 +57,7 @@ export class ListView extends ListViewBase {
|
||||
public _realizedItems = new Map<android.view.View, View>();
|
||||
public _realizedTemplates = new Map<string, Map<android.view.View, View>>();
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public createNativeView() {
|
||||
const listView = new android.widget.ListView(this._context);
|
||||
listView.setDescendantFocusability(android.view.ViewGroup.FOCUS_AFTER_DESCENDANTS);
|
||||
@@ -281,7 +281,7 @@ function ensureListViewAdapterClass() {
|
||||
return itemViewType;
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public getView(index: number, convertView: android.view.View, parent: android.view.ViewGroup): android.view.View {
|
||||
//this.owner._dumpRealizedTemplates();
|
||||
|
||||
|
||||
@@ -273,7 +273,7 @@ export class ListView extends ListViewBase {
|
||||
this.ios.clipsToBounds = true;
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public onLoaded() {
|
||||
super.onLoaded();
|
||||
if (this._isDataDirty) {
|
||||
|
||||
@@ -3,7 +3,7 @@ import { View } from '../core/view';
|
||||
import { Color } from '../../color';
|
||||
import { ActionBar } from '../action-bar';
|
||||
import { GridLayout } from '../layouts/grid-layout';
|
||||
import { device } from '../../platform';
|
||||
import { Device } from '../../platform';
|
||||
import { profile } from '../../profiling';
|
||||
|
||||
export * from './page-common';
|
||||
@@ -43,7 +43,7 @@ export class Page extends PageBase {
|
||||
return super._addViewToNativeVisualTree(child, atIndex);
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public onLoaded() {
|
||||
super.onLoaded();
|
||||
if (!this.hasActionBar && this.actionBarHidden !== true) {
|
||||
@@ -76,7 +76,7 @@ export class Page extends PageBase {
|
||||
color: number;
|
||||
systemUiVisibility: number;
|
||||
} {
|
||||
if (device.sdkVersion >= '21') {
|
||||
if (Device.sdkVersion >= '21') {
|
||||
const window = (<androidx.appcompat.app.AppCompatActivity>this._context).getWindow();
|
||||
const decorView = window.getDecorView();
|
||||
|
||||
@@ -89,7 +89,7 @@ export class Page extends PageBase {
|
||||
return null;
|
||||
}
|
||||
[statusBarStyleProperty.setNative](value: 'dark' | 'light' | { color: number; systemUiVisibility: number }) {
|
||||
if (device.sdkVersion >= '21') {
|
||||
if (Device.sdkVersion >= '21') {
|
||||
const window = (<androidx.appcompat.app.AppCompatActivity>this._context).getWindow();
|
||||
const decorView = window.getDecorView();
|
||||
|
||||
@@ -107,7 +107,7 @@ export class Page extends PageBase {
|
||||
}
|
||||
|
||||
[androidStatusBarBackgroundProperty.getDefault](): number {
|
||||
if (device.sdkVersion >= '21') {
|
||||
if (Device.sdkVersion >= '21') {
|
||||
const window = (<androidx.appcompat.app.AppCompatActivity>this._context).getWindow();
|
||||
|
||||
return (<any>window).getStatusBarColor();
|
||||
@@ -116,7 +116,7 @@ export class Page extends PageBase {
|
||||
return null;
|
||||
}
|
||||
[androidStatusBarBackgroundProperty.setNative](value: number | Color) {
|
||||
if (device.sdkVersion >= '21') {
|
||||
if (Device.sdkVersion >= '21') {
|
||||
const window = (<androidx.appcompat.app.AppCompatActivity>this._context).getWindow();
|
||||
const color = value instanceof Color ? value.android : value;
|
||||
(<any>window).setStatusBarColor(color);
|
||||
|
||||
@@ -133,7 +133,7 @@ class UIViewControllerImpl extends UIViewController {
|
||||
}
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public viewDidAppear(animated: boolean): void {
|
||||
super.viewDidAppear(animated);
|
||||
|
||||
@@ -194,7 +194,7 @@ class UIViewControllerImpl extends UIViewController {
|
||||
}
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public viewWillDisappear(animated: boolean): void {
|
||||
super.viewWillDisappear(animated);
|
||||
|
||||
@@ -223,7 +223,7 @@ class UIViewControllerImpl extends UIViewController {
|
||||
}
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public viewDidDisappear(animated: boolean): void {
|
||||
super.viewDidDisappear(animated);
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ export class PageBase extends ContentView implements PageDefinition {
|
||||
};
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public onNavigatingTo(context: any, isBackNavigation: boolean, bindingContext?: any) {
|
||||
this._navigationContext = context;
|
||||
|
||||
@@ -120,17 +120,17 @@ export class PageBase extends ContentView implements PageDefinition {
|
||||
this.notify(this.createNavigatedData(PageBase.navigatingToEvent, isBackNavigation));
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public onNavigatedTo(isBackNavigation: boolean) {
|
||||
this.notify(this.createNavigatedData(PageBase.navigatedToEvent, isBackNavigation));
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public onNavigatingFrom(isBackNavigation: boolean) {
|
||||
this.notify(this.createNavigatedData(PageBase.navigatingFromEvent, isBackNavigation));
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public onNavigatedFrom(isBackNavigation: boolean) {
|
||||
this.notify(this.createNavigatedData(PageBase.navigatedFromEvent, isBackNavigation));
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ export class Repeater extends CustomLayoutView {
|
||||
*/
|
||||
public itemsLayout: LayoutBase;
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public onLoaded() {
|
||||
if (this._isDirty) {
|
||||
this.refresh();
|
||||
|
||||
@@ -33,7 +33,7 @@ export abstract class ScrollViewBase extends ContentView implements ScrollViewDe
|
||||
}
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public onLoaded() {
|
||||
super.onLoaded();
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Font as FontBase, parseFontFamily, genericFontFamilies, FontStyle, FontWeight } from './font-common';
|
||||
import { Trace } from '../../trace';
|
||||
import { device } from '../../platform';
|
||||
import { Device } from '../../platform';
|
||||
import * as fs from '../../file-system';
|
||||
export * from './font-common';
|
||||
|
||||
@@ -8,7 +8,7 @@ const EMULATE_OBLIQUE = true;
|
||||
const OBLIQUE_TRANSFORM = CGAffineTransformMake(1, 0, 0.2, 1, 0, 0);
|
||||
const DEFAULT_SERIF = 'Times New Roman';
|
||||
const DEFAULT_MONOSPACE = 'Courier New';
|
||||
const SUPPORT_FONT_WEIGHTS = parseFloat(device.osVersion) >= 10.0;
|
||||
const SUPPORT_FONT_WEIGHTS = parseFloat(Device.osVersion) >= 10.0;
|
||||
|
||||
export class Font extends FontBase {
|
||||
public static default = new Font(undefined, undefined, FontStyle.NORMAL, FontWeight.NORMAL);
|
||||
|
||||
@@ -157,7 +157,7 @@ class CSSSource {
|
||||
return new CSSSource(undefined, url, file, keyframes, undefined);
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public static resolveCSSPathFromURL(url: string, importSource?: string): string {
|
||||
const app = knownFolders.currentApp().path;
|
||||
const file = resolveFileNameFromUrl(url, app, File.exists, importSource);
|
||||
@@ -180,13 +180,13 @@ class CSSSource {
|
||||
return this._source;
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
private load(): void {
|
||||
const file = File.fromPath(this._file);
|
||||
this._source = file.readTextSync();
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
private parse(): void {
|
||||
try {
|
||||
if (!this._ast) {
|
||||
@@ -209,7 +209,7 @@ class CSSSource {
|
||||
}
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
private parseCSSAst() {
|
||||
if (this._source) {
|
||||
switch (parser) {
|
||||
@@ -232,7 +232,7 @@ class CSSSource {
|
||||
}
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
private createSelectors() {
|
||||
if (this._ast) {
|
||||
this._selectors = [...this.createSelectorsFromImports(), ...this.createSelectorsFromSyntaxTree()];
|
||||
@@ -447,7 +447,7 @@ export class CssState {
|
||||
this.unsubscribeFromDynamicUpdates();
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
private updateMatch() {
|
||||
const view = this.viewRef.get();
|
||||
if (view && view._styleScope) {
|
||||
@@ -460,7 +460,7 @@ export class CssState {
|
||||
this._matchInvalid = false;
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
private updateDynamicState(): void {
|
||||
const view = this.viewRef.get();
|
||||
if (!view) {
|
||||
@@ -716,7 +716,7 @@ export class StyleScope {
|
||||
this.ensureSelectors();
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
private setCss(cssString: string, cssFileName?): void {
|
||||
this._css = cssString;
|
||||
|
||||
@@ -726,7 +726,7 @@ export class StyleScope {
|
||||
this.ensureSelectors();
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
private appendCss(cssString: string, cssFileName?): void {
|
||||
if (!cssString && !cssFileName) {
|
||||
return;
|
||||
@@ -773,7 +773,7 @@ export class StyleScope {
|
||||
return this._localCssSelectorsAppliedVersion === this._localCssSelectorVersion;
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
private _createSelectors() {
|
||||
let toMerge: RuleSet[][] = [];
|
||||
toMerge.push(applicationCssSelectors);
|
||||
@@ -793,7 +793,7 @@ export class StyleScope {
|
||||
|
||||
// HACK: This @profile decorator creates a circular dependency
|
||||
// HACK: because the function parameter type is evaluated with 'typeof'
|
||||
@profile()
|
||||
@profile
|
||||
public matchSelectors(view: any): SelectorsMatch<ViewBase> {
|
||||
// should be (view: ViewBase): SelectorsMatch<ViewBase>
|
||||
this.ensureSelectors();
|
||||
|
||||
@@ -12,11 +12,11 @@ import { ImageSource } from '../../image-source';
|
||||
import { profile } from '../../profiling';
|
||||
import { Frame } from '../frame';
|
||||
import { layout, ios as iosUtils } from '../../utils';
|
||||
import { device } from '../../platform';
|
||||
import { Device } from '../../platform';
|
||||
export * from './tab-view-common';
|
||||
|
||||
const majorVersion = iosUtils.MajorVersion;
|
||||
const isPhone = device.deviceType === 'Phone';
|
||||
const isPhone = Device.deviceType === 'Phone';
|
||||
|
||||
class UITabBarControllerImpl extends UITabBarController {
|
||||
private _owner: WeakRef<TabView>;
|
||||
@@ -36,7 +36,7 @@ class UITabBarControllerImpl extends UITabBarController {
|
||||
this.extendedLayoutIncludesOpaqueBars = true;
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public viewWillAppear(animated: boolean): void {
|
||||
super.viewWillAppear(animated);
|
||||
const owner = this._owner.get();
|
||||
@@ -51,7 +51,7 @@ class UITabBarControllerImpl extends UITabBarController {
|
||||
}
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public viewDidDisappear(animated: boolean): void {
|
||||
super.viewDidDisappear(animated);
|
||||
const owner = this._owner.get();
|
||||
@@ -295,7 +295,7 @@ export class TabView extends TabViewBase {
|
||||
super.disposeNativeView();
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public onLoaded() {
|
||||
super.onLoaded();
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import { TextTransform } from '../text-base';
|
||||
// Requires
|
||||
import { Color } from '../../color';
|
||||
import { ImageSource } from '../../image-source';
|
||||
import { device } from '../../platform';
|
||||
import { Device } from '../../platform';
|
||||
import { ios as iosUtils, isFontIconURI, layout } from '../../utils';
|
||||
import { ios as iosView, View } from '../core/view';
|
||||
import { ViewBase } from '../core/view-base';
|
||||
@@ -22,7 +22,7 @@ import { swipeEnabledProperty, TabsBase, IOSTabBarItemsAlignment, iOSTabBarItems
|
||||
export * from './tabs-common';
|
||||
|
||||
const majorVersion = iosUtils.MajorVersion;
|
||||
const isPhone = device.deviceType === 'Phone';
|
||||
const isPhone = Device.deviceType === 'Phone';
|
||||
|
||||
// Equivalent to dispatch_async(dispatch_get_main_queue(...)) call
|
||||
const invokeOnRunLoop = (function () {
|
||||
|
||||
@@ -132,7 +132,7 @@ export class TextField extends TextFieldBase {
|
||||
super.disposeNativeView();
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public onLoaded() {
|
||||
super.onLoaded();
|
||||
this.ios.delegate = this._delegate;
|
||||
|
||||
@@ -108,7 +108,7 @@ export class TextView extends TextViewBaseCommon {
|
||||
super.disposeNativeView();
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public onLoaded() {
|
||||
super.onLoaded();
|
||||
this.ios.delegate = this._delegate;
|
||||
|
||||
@@ -124,7 +124,7 @@ export class WebView extends WebViewBase {
|
||||
super.disposeNativeView();
|
||||
}
|
||||
|
||||
@profile()
|
||||
@profile
|
||||
public onLoaded() {
|
||||
super.onLoaded();
|
||||
this.ios.navigationDelegate = this._delegate;
|
||||
|
||||
Reference in New Issue
Block a user