mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Observable needs __extends function which comes from globals in the case of Snapshot.
This commit is contained in:
@@ -101,12 +101,7 @@ class Device implements DeviceDefinition {
|
||||
|
||||
class MainScreen implements ScreenMetricsDefinition {
|
||||
private _metrics: android.util.DisplayMetrics;
|
||||
|
||||
constructor() {
|
||||
// NOTE: This will be memory leak but we MainScreen is singleton
|
||||
appModule.on("cssChanged", this.cssChanged, this);
|
||||
}
|
||||
|
||||
|
||||
private cssChanged(args: appModule.CssChangedEventData): void {
|
||||
if (!this._metrics) {
|
||||
this._metrics = new android.util.DisplayMetrics();
|
||||
@@ -121,6 +116,9 @@ class MainScreen implements ScreenMetricsDefinition {
|
||||
|
||||
private get metrics(): android.util.DisplayMetrics {
|
||||
if (!this._metrics) {
|
||||
// NOTE: This will be memory leak but we MainScreen is singleton
|
||||
appModule.on("cssChanged", this.cssChanged, this);
|
||||
|
||||
this._metrics = new android.util.DisplayMetrics();
|
||||
this.initMetrics();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user