| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ec24c5a commit 2ee1d7d
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -101,8 +101,8 @@ class Device implements DeviceDefinition { | |||
| 101 | 101 | ||
| 102 | 102 | class MainScreen implements ScreenMetricsDefinition { | |
| 103 | 103 | private _metrics: android.util.DisplayMetrics; | |
| 104 | - | ||
| 105 | - private cssChanged(args: appModule.CssChangedEventData): void { | ||
| 104 | + | ||
| 105 | + private reinitMetrics(): void { | ||
| 106 | 106 | if (!this._metrics) { | |
| 107 | 107 | this._metrics = new android.util.DisplayMetrics(); | |
| 108 | 108 | } | |
@@ -117,7 +117,8 @@ class MainScreen implements ScreenMetricsDefinition { | |||
| 117 | 117 | private get metrics(): android.util.DisplayMetrics { | |
| 118 | 118 | if (!this._metrics) { | |
| 119 | 119 | // NOTE: This will be memory leak but we MainScreen is singleton | |
| 120 | - appModule.on("cssChanged", this.cssChanged, this); | ||
| 120 | + appModule.on("cssChanged", this.reinitMetrics, this); | ||
| 121 | + appModule.on(appModule.orientationChangedEvent, this.reinitMetrics, this); | ||
| 121 | 122 | ||
| 122 | 123 | this._metrics = new android.util.DisplayMetrics(); | |
| 123 | 124 | this.initMetrics(); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments