From 2936ef174c9e34e6fb7807c23623a4041a1efd44 Mon Sep 17 00:00:00 2001 From: Aman Harwara Date: Tue, 15 Aug 2023 15:40:49 +0530 Subject: [PATCH] refactor: auto-detect if theme is a dark theme and apply correct status bar colors --- packages/mobile/ios/Podfile.lock | 4 ++-- packages/ui-services/src/Theme/ThemeManager.ts | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/mobile/ios/Podfile.lock b/packages/mobile/ios/Podfile.lock index 502c74129..98c9e2a32 100644 --- a/packages/mobile/ios/Podfile.lock +++ b/packages/mobile/ios/Podfile.lock @@ -723,7 +723,7 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/ReactCommon/yoga" SPEC CHECKSUMS: - boost: a7c83b31436843459a1961bfd74b96033dc77234 + boost: 57d2868c099736d80fcd648bf211b4431e51a558 CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54 FBLazyVector: 4cce221dd782d3ff7c4172167bba09d58af67ccb @@ -743,7 +743,7 @@ SPEC CHECKSUMS: MMKV: 9c4663aa7ca255d478ff10f2f5cb7d17c1651ccd MMKVCore: 89f5c8a66bba2dcd551779dea4d412eeec8ff5bb OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c - RCT-Folly: 0080d0a6ebf2577475bda044aa59e2ca1f909cda + RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1 RCTRequired: a2faf4bad4e438ca37b2040cb8f7799baa065c18 RCTTypeSafety: cb09f3e4747b6d18331a15eb05271de7441ca0b3 React: 13109005b5353095c052f26af37413340ccf7a5d diff --git a/packages/ui-services/src/Theme/ThemeManager.ts b/packages/ui-services/src/Theme/ThemeManager.ts index ac8462d1f..c51d74ed8 100644 --- a/packages/ui-services/src/Theme/ThemeManager.ts +++ b/packages/ui-services/src/Theme/ThemeManager.ts @@ -337,10 +337,11 @@ export class ThemeManager extends AbstractUIService { link.onload = () => { this.syncThemeColorMetadata() - if (this.application.isNativeMobileWeb() && !theme.layerable) { - const packageInfo = theme.featureDescription + if (this.application.isNativeMobileWeb()) { setTimeout(() => { - this.application.mobileDevice.handleThemeSchemeChange(packageInfo.isDark ?? false, this.getBackgroundColor()) + const backgroundColorString = this.getBackgroundColor() + const backgroundColor = new Color(backgroundColorString) + this.application.mobileDevice.handleThemeSchemeChange(backgroundColor.isDark(), backgroundColorString) }) }