-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix#5873 - Share sheet not in dark mode (#6024)
* Fix#5873 - Share sheet not in dark mode * #5873: Create theme for shareExtension
- Loading branch information
Showing
7 changed files
with
61 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+1.7 KB
(200%)
Extensions/ShareTo/Images.xcassets/Icon-Small.imageset/icon-40.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+5.77 KB
(230%)
Extensions/ShareTo/Images.xcassets/Icon-Small.imageset/icon-40@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+10.6 KB
(240%)
Extensions/ShareTo/Images.xcassets/Icon-Small.imageset/icon-40@3x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
import UIKit | ||
|
||
private enum ColorScheme { | ||
case dark | ||
case light | ||
} | ||
|
||
public struct ModernColor { | ||
var darkColor: UIColor | ||
var lightColor: UIColor | ||
|
||
public init(dark: UIColor, light: UIColor) { | ||
self.darkColor = dark | ||
self.lightColor = light | ||
} | ||
|
||
public var color: UIColor { | ||
if #available(iOS 13, *) { | ||
return UIColor { (traitCollection: UITraitCollection) -> UIColor in | ||
if traitCollection.userInterfaceStyle == .dark { | ||
return self.color(for: .dark) | ||
} else { | ||
return self.color(for: .light) | ||
} | ||
} | ||
} else { | ||
return color(for: .light) | ||
} | ||
} | ||
|
||
private func color(for scheme: ColorScheme) -> UIColor { | ||
return scheme == .dark ? darkColor : lightColor | ||
} | ||
} | ||
|
||
struct Theme { | ||
static let defaultBackground = ModernColor(dark: UIColor.Photon.Grey80, light: .white) | ||
static let doneLabelBackground = ModernColor(dark: UIColor.Photon.Blue40, light: UIColor.Photon.Blue40) | ||
static let separator = ModernColor(dark: UIColor.Photon.Grey10, light: UIColor.Photon.Grey30) | ||
static let actionRowTextAndIcon = ModernColor(dark: .white, light: UIColor.Photon.Grey80) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters