mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
refactor: circular deps part 13
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Application } from '../../application';
|
||||
import { getNativeApp } from '../../application/helpers-common';
|
||||
import { SDK_VERSION } from '../../utils/constants';
|
||||
import { platformNames } from '../common';
|
||||
import { Screen } from '../screen';
|
||||
@@ -65,7 +65,7 @@ class DeviceRef {
|
||||
|
||||
get uuid(): string {
|
||||
if (!this._uuid) {
|
||||
const nativeApp = Application.android.getNativeApplication();
|
||||
const nativeApp = getNativeApp() as android.app.Application;
|
||||
this._uuid = android.provider.Settings.Secure.getString(nativeApp.getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { Application } from '../../application';
|
||||
import { getNativeApp } from '../../application/helpers-common';
|
||||
|
||||
class MainScreen {
|
||||
private _metrics: android.util.DisplayMetrics;
|
||||
|
||||
private initMetrics(): void {
|
||||
const nativeApp = Application.android.getNativeApplication();
|
||||
const nativeApp = getNativeApp() as android.app.Application;
|
||||
nativeApp.getSystemService(android.content.Context.WINDOW_SERVICE).getDefaultDisplay().getRealMetrics(this._metrics);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user