refactor(dark-mode): arrow functions to properties

This commit is contained in:
Vasil Chimev
2019-09-17 18:26:45 +03:00
parent cb92ca07af
commit cb1f7cc182
5 changed files with 18 additions and 21 deletions

View File

@@ -82,14 +82,13 @@ class CADisplayLinkTarget extends NSObject {
}
class IOSApplication implements IOSApplicationDefinition {
private _backgroundColor = majorVersion <= 12 ? UIColor.whiteColor : UIColor.systemBackgroundColor;
private _delegate: typeof UIApplicationDelegate;
private _window: UIWindow;
private _observers: Array<NotificationObserver>;
private _orientation: "portrait" | "landscape" | "unknown";
private _rootView: View;
private getBackgroundColor = () => majorVersion <= 12 ? UIColor.whiteColor : UIColor.systemBackgroundColor;
constructor() {
this._observers = new Array<NotificationObserver>();
this.addNotificationObserver(UIApplicationDidFinishLaunchingNotification, this.didFinishLaunchingWithOptions.bind(this));
@@ -162,7 +161,7 @@ class IOSApplication implements IOSApplicationDefinition {
this._window = UIWindow.alloc().initWithFrame(UIScreen.mainScreen.bounds);
// TODO: Expose Window module so that it can we styled from XML & CSS
this._window.backgroundColor = this.getBackgroundColor();
this._window.backgroundColor = this._backgroundColor;
this.notifyAppStarted(notification);
}