fix: content warning overlay and setting separator line not using theme color issue

This commit is contained in:
CMK 2021-07-07 17:52:06 +08:00
parent 4138b05ac9
commit 6f7acc0173
4 changed files with 21 additions and 7 deletions

View File

@ -23,9 +23,9 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.263",
"green" : "0.208",
"red" : "0.192"
"blue" : "0x6E",
"green" : "0x57",
"red" : "0x4F"
}
},
"idiom" : "universal"

View File

@ -23,9 +23,9 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.263",
"green" : "0.208",
"red" : "0.192"
"blue" : "60",
"green" : "58",
"red" : "58"
}
},
"idiom" : "universal"

View File

@ -236,6 +236,8 @@ class SettingsViewController: UIViewController, NeedsDependency {
return theme.secondarySystemBackgroundColor
}
})
tableView.separatorColor = theme.separator
}
private func setupNavigation() {

View File

@ -17,6 +17,7 @@ protocol ContentWarningOverlayViewDelegate: AnyObject {
class ContentWarningOverlayView: UIView {
var disposeBag = Set<AnyCancellable>()
private var _disposeBag = Set<AnyCancellable>()
static let cornerRadius: CGFloat = 4
static let blurVisualEffect = UIBlurEffect(style: .systemUltraThinMaterial)
@ -36,7 +37,6 @@ class ContentWarningOverlayView: UIView {
// for status style overlay
let contentOverlayView: UIView = {
let view = UIView()
view.backgroundColor = ThemeService.shared.currentTheme.value.contentWarningOverlayBackgroundColor
view.applyCornerRadius(radius: ContentWarningOverlayView.cornerRadius)
return view
}()
@ -156,6 +156,18 @@ extension ContentWarningOverlayView {
addGestureRecognizer(tapGestureRecognizer)
configure(style: .media)
setupBackgroundColor(theme: ThemeService.shared.currentTheme.value)
ThemeService.shared.currentTheme
.receive(on: RunLoop.main)
.sink { [weak self] theme in
guard let self = self else { return }
self.setupBackgroundColor(theme: theme)
}
.store(in: &_disposeBag)
}
private func setupBackgroundColor(theme: Theme) {
contentOverlayView.backgroundColor = theme.contentWarningOverlayBackgroundColor
}
}