feat(ios-dark-mode): adapt dynamic system colors (#7826)

This commit is contained in:
Vasil Chimev
2019-10-04 10:58:54 +03:00
committed by GitHub
parent 82f2ccbdfb
commit f82cf08f95
7 changed files with 59 additions and 21 deletions

View File

@@ -27,6 +27,7 @@ import { ios } from "../utils/utils";
const IOS_PLATFORM = "ios";
const getVisibleViewController = ios.getVisibleViewController;
const majorVersion = ios.MajorVersion;
// NOTE: UIResponder with implementation of window - related to https://github.com/NativeScript/ios-runtime/issues/430
// TODO: Refactor the UIResponder to use Typescript extends when this issue is resolved:
@@ -81,6 +82,7 @@ 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>;
@@ -159,10 +161,9 @@ 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 = UIColor.whiteColor;
this._window.backgroundColor = this._backgroundColor;
this.notifyAppStarted(notification);
}
public notifyAppStarted(notification?: NSNotification) {