mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-26 03:01:51 +08:00
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:

committed by
Nathan Walker

parent
963d0243de
commit
f64355ba7a
@ -1,5 +1,5 @@
|
||||
import * as textModule from '../text';
|
||||
import { getNativeApplication } from '../application';
|
||||
import { Application } from '../application';
|
||||
import { getFileExtension } from '../utils';
|
||||
import { SDK_VERSION } from '../utils/constants';
|
||||
|
||||
@ -8,7 +8,7 @@ import type { IFileSystemAccess } from './file-system-access';
|
||||
let applicationContext: android.content.Context;
|
||||
function getApplicationContext() {
|
||||
if (!applicationContext) {
|
||||
applicationContext = (<android.app.Application>getNativeApplication()).getApplicationContext();
|
||||
applicationContext = Application.android.getNativeApplication().getApplicationContext();
|
||||
}
|
||||
|
||||
return applicationContext;
|
||||
@ -574,7 +574,7 @@ export class FileSystemAccess implements IFileSystemAccess {
|
||||
// TODO: bufferedReader.read(CharBuffer) does not currently work
|
||||
let line = undefined;
|
||||
let result = '';
|
||||
while (true) {
|
||||
while (line !== null) {
|
||||
line = bufferedReader.readLine();
|
||||
if (line === null) {
|
||||
break;
|
||||
|
Reference in New Issue
Block a user