From 76d7c0256a19740e177fa3ff5db0b866d2e6a7d7 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Wed, 16 Oct 2019 20:53:49 -0500 Subject: [PATCH] Fix full screen image background color for dark mode --- iOS/AppAssets.swift | 4 +++ iOS/Article/ImageTransition.swift | 2 +- iOS/Base.lproj/Main.storyboard | 5 ++- .../Contents.json | 31 +++++++++++++++++++ 4 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 iOS/Resources/Assets.xcassets/fullScreenBackgroundColor.colorset/Contents.json diff --git a/iOS/AppAssets.swift b/iOS/AppAssets.swift index a31ac6ea5..2ca4fda10 100644 --- a/iOS/AppAssets.swift +++ b/iOS/AppAssets.swift @@ -68,6 +68,10 @@ struct AppAssets { return RSImage(named: "faviconTemplateImage")! }() + static var fullScreenBackgroundColor: UIColor = { + return UIColor(named: "fullScreenBackgroundColor")! + }() + static var infoImage: UIImage = { UIImage(systemName: "info.circle")! }() diff --git a/iOS/Article/ImageTransition.swift b/iOS/Article/ImageTransition.swift index 17a14c926..0c17a59b9 100644 --- a/iOS/Article/ImageTransition.swift +++ b/iOS/Article/ImageTransition.swift @@ -41,7 +41,7 @@ class ImageTransition: NSObject, UIViewControllerAnimatedTransitioning { let fromView = transitionContext.view(forKey: .from)! fromView.removeFromSuperview() - transitionContext.containerView.backgroundColor = UIColor.systemBackground + transitionContext.containerView.backgroundColor = AppAssets.fullScreenBackgroundColor transitionContext.containerView.addSubview(imageView) articleController?.hideClickedImage() diff --git a/iOS/Base.lproj/Main.storyboard b/iOS/Base.lproj/Main.storyboard index 14b53813d..df20db9ac 100644 --- a/iOS/Base.lproj/Main.storyboard +++ b/iOS/Base.lproj/Main.storyboard @@ -265,7 +265,7 @@ - + @@ -299,6 +299,9 @@ + + + diff --git a/iOS/Resources/Assets.xcassets/fullScreenBackgroundColor.colorset/Contents.json b/iOS/Resources/Assets.xcassets/fullScreenBackgroundColor.colorset/Contents.json new file mode 100644 index 000000000..ccbb901d9 --- /dev/null +++ b/iOS/Resources/Assets.xcassets/fullScreenBackgroundColor.colorset/Contents.json @@ -0,0 +1,31 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + }, + "colors" : [ + { + "idiom" : "universal", + "color" : { + "platform" : "ios", + "reference" : "systemBackgroundColor" + } + }, + { + "idiom" : "universal", + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "gray-gamma-22", + "components" : { + "white" : "0.000", + "alpha" : "1.000" + } + } + } + ] +} \ No newline at end of file