mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
chore: cleanup reexports
This commit is contained in:
@@ -333,21 +333,21 @@ function initLifecycleCallbacks() {
|
||||
});
|
||||
|
||||
const lifecycleCallbacks = new android.app.Application.ActivityLifecycleCallbacks({
|
||||
onActivityCreated: profile("onActivityCreated", function (activity: androidx.appcompat.app.AppCompatActivity, savedInstanceState: android.os.Bundle) {
|
||||
setThemeOnLaunch(activity);
|
||||
onActivityCreated: <any>profile("onActivityCreated", function (activity: androidx.appcompat.app.AppCompatActivity, savedInstanceState: android.os.Bundle) {
|
||||
setThemeOnLaunch(activity, undefined, undefined);
|
||||
|
||||
if (!androidApp.startActivity) {
|
||||
androidApp.startActivity = activity;
|
||||
}
|
||||
|
||||
notifyActivityCreated(activity, savedInstanceState);
|
||||
notifyActivityCreated(activity, <any>savedInstanceState, undefined);
|
||||
|
||||
if (hasListeners(displayedEvent)) {
|
||||
subscribeForGlobalLayout(activity);
|
||||
subscribeForGlobalLayout(activity, undefined, undefined);
|
||||
}
|
||||
}),
|
||||
|
||||
onActivityDestroyed: profile("onActivityDestroyed", function (activity: androidx.appcompat.app.AppCompatActivity) {
|
||||
onActivityDestroyed: <any>profile("onActivityDestroyed", function (activity: androidx.appcompat.app.AppCompatActivity) {
|
||||
if (activity === androidApp.foregroundActivity) {
|
||||
androidApp.foregroundActivity = undefined;
|
||||
}
|
||||
@@ -361,7 +361,7 @@ function initLifecycleCallbacks() {
|
||||
gc();
|
||||
}),
|
||||
|
||||
onActivityPaused: profile("onActivityPaused", function (activity: androidx.appcompat.app.AppCompatActivity) {
|
||||
onActivityPaused: <any>profile("onActivityPaused", function (activity: androidx.appcompat.app.AppCompatActivity) {
|
||||
if ((<any>activity).isNativeScriptActivity) {
|
||||
androidApp.paused = true;
|
||||
notify(<ApplicationEventData>{ eventName: suspendEvent, object: androidApp, android: activity });
|
||||
@@ -370,21 +370,21 @@ function initLifecycleCallbacks() {
|
||||
androidApp.notify(<AndroidActivityEventData>{ eventName: ActivityPaused, object: androidApp, activity: activity });
|
||||
}),
|
||||
|
||||
onActivityResumed: profile("onActivityResumed", function (activity: androidx.appcompat.app.AppCompatActivity) {
|
||||
onActivityResumed: <any>profile("onActivityResumed", function (activity: androidx.appcompat.app.AppCompatActivity) {
|
||||
androidApp.foregroundActivity = activity;
|
||||
|
||||
androidApp.notify(<AndroidActivityEventData>{ eventName: ActivityResumed, object: androidApp, activity: activity });
|
||||
}),
|
||||
|
||||
onActivitySaveInstanceState: profile("onActivitySaveInstanceState", function (activity: androidx.appcompat.app.AppCompatActivity, outState: android.os.Bundle) {
|
||||
onActivitySaveInstanceState: <any>profile("onActivitySaveInstanceState", function (activity: androidx.appcompat.app.AppCompatActivity, outState: android.os.Bundle) {
|
||||
androidApp.notify(<AndroidActivityBundleEventData>{ eventName: SaveActivityState, object: androidApp, activity: activity, bundle: outState });
|
||||
}),
|
||||
|
||||
onActivityStarted: profile("onActivityStarted", function (activity: androidx.appcompat.app.AppCompatActivity) {
|
||||
onActivityStarted: <any>profile("onActivityStarted", function (activity: androidx.appcompat.app.AppCompatActivity) {
|
||||
androidApp.notify(<AndroidActivityEventData>{ eventName: ActivityStarted, object: androidApp, activity: activity });
|
||||
}),
|
||||
|
||||
onActivityStopped: profile("onActivityStopped", function (activity: androidx.appcompat.app.AppCompatActivity) {
|
||||
onActivityStopped: <any>profile("onActivityStopped", function (activity: androidx.appcompat.app.AppCompatActivity) {
|
||||
androidApp.notify(<AndroidActivityEventData>{ eventName: ActivityStopped, object: androidApp, activity: activity });
|
||||
})
|
||||
});
|
||||
@@ -394,17 +394,17 @@ function initLifecycleCallbacks() {
|
||||
|
||||
function initComponentCallbacks() {
|
||||
let componentCallbacks = new android.content.ComponentCallbacks2({
|
||||
onLowMemory: profile("onLowMemory", function () {
|
||||
onLowMemory: <any>profile("onLowMemory", function () {
|
||||
gc();
|
||||
java.lang.System.gc();
|
||||
notify(<ApplicationEventData>{ eventName: lowMemoryEvent, object: this, android: this });
|
||||
}),
|
||||
|
||||
onTrimMemory: profile("onTrimMemory", function (level: number) {
|
||||
onTrimMemory: <any>profile("onTrimMemory", function (level: number) {
|
||||
// TODO: This is skipped for now, test carefully for OutOfMemory exceptions
|
||||
}),
|
||||
|
||||
onConfigurationChanged: profile("onConfigurationChanged", function (newConfiguration: android.content.res.Configuration) {
|
||||
onConfigurationChanged: <any>profile("onConfigurationChanged", function (newConfiguration: android.content.res.Configuration) {
|
||||
const rootView = getRootView();
|
||||
const newOrientation = getOrientationValue(newConfiguration);
|
||||
|
||||
@@ -28,8 +28,8 @@ import {
|
||||
pushToSystemCssClasses,
|
||||
ROOT_VIEW_CSS_CLASS
|
||||
} from "../css/system-classes";
|
||||
import { ios as iosViewHelper } from "../ui/core/view/view-helper";
|
||||
import { device } from "../platform/platform";
|
||||
import { IOSHelper } from "../ui/core/view/view-helper";
|
||||
import { device } from "../platform";
|
||||
import { profile } from "../profiling";
|
||||
import { ios } from "../utils/utils";
|
||||
|
||||
@@ -176,7 +176,7 @@ export class iOSApplication implements iOSApplicationDefinition {
|
||||
}
|
||||
}
|
||||
|
||||
@profile
|
||||
@profile()
|
||||
private didFinishLaunchingWithOptions(notification: NSNotification) {
|
||||
if (!displayedOnce) {
|
||||
displayedLinkTarget = CADisplayLinkTarget.new();
|
||||
@@ -210,7 +210,7 @@ export class iOSApplication implements iOSApplicationDefinition {
|
||||
}
|
||||
}
|
||||
|
||||
@profile
|
||||
@profile()
|
||||
private didBecomeActive(notification: NSNotification) {
|
||||
const ios = UIApplication.sharedApplication;
|
||||
const object = this;
|
||||
@@ -310,7 +310,7 @@ export class iOSApplication implements iOSApplicationDefinition {
|
||||
this._window.makeKeyAndVisible();
|
||||
}
|
||||
|
||||
rootView.on(iosViewHelper.traitCollectionColorAppearanceChangedEvent, () => {
|
||||
rootView.on(IOSHelper.traitCollectionColorAppearanceChangedEvent, () => {
|
||||
const userInterfaceStyle = controller.traitCollection.userInterfaceStyle;
|
||||
const newSystemAppearance = getSystemAppearanceValue(userInterfaceStyle);
|
||||
|
||||
@@ -396,7 +396,7 @@ export function run(entry?: string | NavigationEntry) {
|
||||
// Mind root view CSS classes in future work
|
||||
// on embedding NativeScript applications
|
||||
setRootViewsSystemAppearanceCssClass(rootView);
|
||||
rootView.on(iosViewHelper.traitCollectionColorAppearanceChangedEvent, () => {
|
||||
rootView.on(IOSHelper.traitCollectionColorAppearanceChangedEvent, () => {
|
||||
const userInterfaceStyle = controller.traitCollection.userInterfaceStyle;
|
||||
const newSystemAppearance = getSystemAppearanceValue(userInterfaceStyle);
|
||||
|
||||
@@ -453,7 +453,7 @@ function getViewController(rootView: View): UIViewController {
|
||||
if (!(viewController instanceof UIViewController)) {
|
||||
// We set UILayoutViewController dynamically to the root view if it doesn't have a view controller
|
||||
// At the moment the root view doesn't have its native view created. We set it in the setViewControllerView func
|
||||
viewController = iosViewHelper.UILayoutViewController.initWithOwner(new WeakRef(rootView)) as UIViewController;
|
||||
viewController = IOSHelper.UILayoutViewController.initWithOwner(new WeakRef(rootView)) as UIViewController;
|
||||
rootView.viewController = viewController;
|
||||
}
|
||||
|
||||
@@ -468,7 +468,7 @@ function setViewControllerView(view: View): void {
|
||||
throw new Error("Root should be either UIViewController or UIView");
|
||||
}
|
||||
|
||||
if (viewController instanceof iosViewHelper.UILayoutViewController) {
|
||||
if (viewController instanceof IOSHelper.UILayoutViewController) {
|
||||
viewController.view.addSubview(nativeView);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"name": "application",
|
||||
"main": "application",
|
||||
"types": "application.d.ts",
|
||||
"nativescript": {}
|
||||
}
|
||||
Reference in New Issue
Block a user