mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
chore: cleanup
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user