refactor: improved core barrel exports and Application class (#10286)

BREAKING CHANGES:

`Application.orientation` is no longer a function.

Migration: Remove `()` from the `Application.orientation()` call:
```diff
import { Application } from "@nativescript/core";

-console.log(Application.orientation());
+console.log(Application.orientation);
```


`Application.systemAppearance` is no longer a function.

Migration: Remove `()` from the `Application.systemAppearance()` call:
```diff
import { Application } from "@nativescript/core";

-console.log(Application.systemAppearance());
+console.log(Application.systemAppearance);
```
This commit is contained in:
Igor Randjelovic
2023-05-17 21:02:06 +02:00
committed by Nathan Walker
parent 963d0243de
commit f64355ba7a
67 changed files with 3536 additions and 3678 deletions

View File

@@ -1,10 +1,10 @@
import * as common from './application-settings-common';
import { getNativeApplication } from '../application';
import { Application } from '../application';
let sharedPreferences: android.content.SharedPreferences;
function ensureSharedPreferences() {
if (!sharedPreferences) {
sharedPreferences = (<android.app.Application>getNativeApplication()).getApplicationContext().getSharedPreferences('prefs.db', 0);
sharedPreferences = Application.android.getNativeApplication().getApplicationContext().getSharedPreferences('prefs.db', 0);
}
}