mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
feat: expose application orientation (#7602)
This commit is contained in:
@@ -19,10 +19,6 @@ class Device implements DeviceDefinition {
|
||||
private _language: string;
|
||||
private _region: string;
|
||||
|
||||
get os(): string {
|
||||
return platformNames.android;
|
||||
}
|
||||
|
||||
get manufacturer(): string {
|
||||
if (!this._manufacturer) {
|
||||
this._manufacturer = android.os.Build.MANUFACTURER;
|
||||
@@ -31,6 +27,10 @@ class Device implements DeviceDefinition {
|
||||
return this._manufacturer;
|
||||
}
|
||||
|
||||
get os(): string {
|
||||
return platformNames.android;
|
||||
}
|
||||
|
||||
get osVersion(): string {
|
||||
if (!this._osVersion) {
|
||||
this._osVersion = android.os.Build.VERSION.RELEASE;
|
||||
|
||||
2
tns-core-modules/platform/platform.d.ts
vendored
2
tns-core-modules/platform/platform.d.ts
vendored
@@ -125,4 +125,4 @@ export module screen {
|
||||
/**
|
||||
* Gets the current device information.
|
||||
*/
|
||||
export const device: Device;
|
||||
export const device: Device;
|
||||
|
||||
@@ -78,7 +78,7 @@ class Device implements DeviceDefinition {
|
||||
const languages = NSLocale.preferredLanguages;
|
||||
this._language = languages[0];
|
||||
}
|
||||
|
||||
|
||||
return this._language;
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ class Device implements DeviceDefinition {
|
||||
|
||||
class MainScreen implements ScreenMetricsDefinition {
|
||||
private _screen: UIScreen;
|
||||
|
||||
|
||||
private get screen(): UIScreen {
|
||||
if (!this._screen) {
|
||||
this._screen = UIScreen.mainScreen;
|
||||
|
||||
Reference in New Issue
Block a user