chore: update color panel

This commit is contained in:
CMK 2022-02-15 18:15:58 +08:00
parent 94470c9f1b
commit d4a4e4ba3d
30 changed files with 145 additions and 65 deletions

View File

@ -669,8 +669,16 @@ extension ComposeViewController {
}
private func setupBackgroundColor(theme: Theme) {
view.backgroundColor = theme.systemElevatedBackgroundColor
tableView.backgroundColor = theme.systemElevatedBackgroundColor
let backgroundColor = UIColor(dynamicProvider: { traitCollection in
switch traitCollection.userInterfaceStyle {
case .light:
return .systemBackground
default:
return theme.systemElevatedBackgroundColor
}
})
view.backgroundColor = backgroundColor
tableView.backgroundColor = backgroundColor
composeToolbarBackgroundView.backgroundColor = theme.composeToolbarBackgroundColor
}

View File

@ -16,6 +16,7 @@ final class NotificationTableViewCell: UITableViewCell {
weak var delegate: NotificationTableViewCellDelegate?
var disposeBag = Set<AnyCancellable>()
private var _disposeBag = Set<AnyCancellable>()
let notificationView = NotificationView()
@ -66,6 +67,14 @@ extension NotificationTableViewCell {
separatorLine.heightAnchor.constraint(equalToConstant: UIView.separatorLineHeight(of: contentView)).priority(.required - 1),
])
notificationView.quoteBackgroundView.backgroundColor = ThemeService.shared.currentTheme.value.secondarySystemBackgroundColor
ThemeService.shared.currentTheme
.sink { [weak self] theme in
guard let self = self else { return }
self.notificationView.quoteBackgroundView.backgroundColor = theme.secondarySystemBackgroundColor
}
.store(in: &_disposeBag)
notificationView.delegate = self
}

View File

@ -51,7 +51,7 @@ final class MastodonConfirmEmailViewController: UIViewController, NeedsDependenc
let navigationActionView: NavigationActionView = {
let navigationActionView = NavigationActionView()
navigationActionView.backgroundColor = Asset.Scene.Onboarding.onboardingBackground.color
navigationActionView.backgroundColor = Asset.Scene.Onboarding.background.color
return navigationActionView
}()

View File

@ -51,7 +51,7 @@ final class MastodonPickServerViewController: UIViewController, NeedsDependency
let navigationActionView: NavigationActionView = {
let navigationActionView = NavigationActionView()
navigationActionView.backgroundColor = Asset.Scene.Onboarding.onboardingBackground.color
navigationActionView.backgroundColor = Asset.Scene.Onboarding.background.color
return navigationActionView
}()

View File

@ -114,7 +114,7 @@ class PickServerCell: UITableViewCell {
extension PickServerCell {
private func _init() {
selectionStyle = .none
backgroundColor = Asset.Scene.Onboarding.onboardingBackground.color
backgroundColor = Asset.Scene.Onboarding.background.color
checkbox.translatesAutoresizingMaskIntoConstraints = false
contentView.addSubview(checkbox)

View File

@ -136,7 +136,7 @@ final class PickServerServerSectionTableHeaderView: UIView {
extension PickServerServerSectionTableHeaderView {
private func _init() {
preservesSuperviewLayoutMargins = true
backgroundColor = Asset.Scene.Onboarding.onboardingBackground.color
backgroundColor = Asset.Scene.Onboarding.background.color
collectionView.translatesAutoresizingMaskIntoConstraints = false
collectionView.preservesSuperviewLayoutMargins = true

View File

@ -69,7 +69,7 @@ final class MastodonRegisterViewController: UIViewController, NeedsDependency, O
let navigationActionView: NavigationActionView = {
let navigationActionView = NavigationActionView()
navigationActionView.backgroundColor = Asset.Scene.Onboarding.onboardingBackground.color
navigationActionView.backgroundColor = Asset.Scene.Onboarding.background.color
return navigationActionView
}()

View File

@ -46,7 +46,7 @@ final class MastodonServerRulesViewController: UIViewController, NeedsDependency
let navigationActionView: NavigationActionView = {
let navigationActionView = NavigationActionView()
navigationActionView.backgroundColor = Asset.Scene.Onboarding.onboardingBackground.color
navigationActionView.backgroundColor = Asset.Scene.Onboarding.background.color
return navigationActionView
}()

View File

@ -46,7 +46,7 @@ extension OnboardingHeadlineTableViewCell {
private func _init() {
selectionStyle = .none
backgroundColor = Asset.Scene.Onboarding.onboardingBackground.color
backgroundColor = Asset.Scene.Onboarding.background.color
let container = UIStackView()
container.axis = .vertical

View File

@ -40,7 +40,7 @@ extension OnboardingViewControllerAppearance {
}
func setupOnboardingAppearance() {
view.backgroundColor = Asset.Scene.Onboarding.onboardingBackground.color
view.backgroundColor = Asset.Scene.Onboarding.background.color
setupNavigationBarAppearance()
@ -72,7 +72,7 @@ extension OnboardingViewControllerAppearance {
func setupNavigationBarBackgroundView() {
let navigationBarBackgroundView: UIView = {
let view = UIView()
view.backgroundColor = Asset.Scene.Onboarding.onboardingBackground.color
view.backgroundColor = Asset.Scene.Onboarding.background.color
return view
}()

View File

@ -13,7 +13,7 @@ final class ProfileRelationshipActionButton: RoundedEdgesButton {
let activityIndicatorView: UIActivityIndicatorView = {
let activityIndicatorView = UIActivityIndicatorView(style: .medium)
activityIndicatorView.color = .white
activityIndicatorView.color = Asset.Colors.Label.primaryReverse.color
return activityIndicatorView
}()
@ -44,19 +44,21 @@ extension ProfileRelationshipActionButton {
activityIndicatorView.hidesWhenStopped = true
activityIndicatorView.stopAnimating()
}
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
super.traitCollectionDidChange(previousTraitCollection)
if traitCollection.hasDifferentColorAppearance(comparedTo: previousTraitCollection) {
configureAppearance()
}
}
}
extension ProfileRelationshipActionButton {
func configure(actionOptionSet: ProfileViewModel.RelationshipActionOptionSet) {
setTitle(actionOptionSet.title, for: .normal)
setTitleColor(.white, for: .normal)
setTitleColor(UIColor.white.withAlphaComponent(0.5), for: .highlighted)
setBackgroundImage(.placeholder(color: Asset.Scene.Profile.RelationshipButton.background.color), for: .normal)
setBackgroundImage(.placeholder(color: Asset.Scene.Profile.RelationshipButton.backgroundHighlighted.color), for: .highlighted)
setBackgroundImage(.placeholder(color: Asset.Scene.Profile.RelationshipButton.backgroundHighlighted.color), for: .disabled)
// setBackgroundImage(.placeholder(color: actionOptionSet.backgroundColor), for: .normal)
// setBackgroundImage(.placeholder(color: actionOptionSet.backgroundColor.withAlphaComponent(0.5)), for: .highlighted)
// setBackgroundImage(.placeholder(color: actionOptionSet.backgroundColor.withAlphaComponent(0.5)), for: .disabled)
configureAppearance()
titleEdgeInsets = UIEdgeInsets(top: 0, left: 4, bottom: 0, right: 4)
@ -71,5 +73,16 @@ extension ProfileRelationshipActionButton {
isEnabled = true
}
}
private func configureAppearance() {
setTitleColor(Asset.Colors.Label.primaryReverse.color, for: .normal)
setTitleColor(Asset.Colors.Label.primaryReverse.color.withAlphaComponent(0.5), for: .highlighted)
setBackgroundImage(.placeholder(color: Asset.Scene.Profile.RelationshipButton.background.color), for: .normal)
setBackgroundImage(.placeholder(color: Asset.Scene.Profile.RelationshipButton.backgroundHighlighted.color), for: .highlighted)
setBackgroundImage(.placeholder(color: Asset.Scene.Profile.RelationshipButton.backgroundHighlighted.color), for: .disabled)
// setBackgroundImage(.placeholder(color: actionOptionSet.backgroundColor), for: .normal)
// setBackgroundImage(.placeholder(color: actionOptionSet.backgroundColor.withAlphaComponent(0.5)), for: .highlighted)
// setBackgroundImage(.placeholder(color: actionOptionSet.backgroundColor.withAlphaComponent(0.5)), for: .disabled)
}
}

View File

@ -39,7 +39,7 @@ final class ReportResultViewController: UIViewController, NeedsDependency, Repor
let navigationActionView: NavigationActionView = {
let navigationActionView = NavigationActionView()
navigationActionView.backgroundColor = Asset.Scene.Onboarding.onboardingBackground.color
navigationActionView.backgroundColor = Asset.Scene.Onboarding.background.color
navigationActionView.hidesBackButton = true
navigationActionView.nextButton.setTitle(L10n.Common.Controls.Actions.done, for: .normal)
return navigationActionView

View File

@ -47,7 +47,7 @@ class ReportViewController: UIViewController, NeedsDependency, ReportViewControl
let navigationActionView: NavigationActionView = {
let navigationActionView = NavigationActionView()
navigationActionView.backgroundColor = Asset.Scene.Onboarding.onboardingBackground.color
navigationActionView.backgroundColor = Asset.Scene.Onboarding.background.color
navigationActionView.backButton.setTitle(L10n.Common.Controls.Actions.skip, for: .normal)
return navigationActionView
}()

View File

@ -55,7 +55,7 @@ final class ReportSupplementaryViewController: UIViewController, NeedsDependency
let navigationActionView: NavigationActionView = {
let navigationActionView = NavigationActionView()
navigationActionView.backgroundColor = Asset.Scene.Onboarding.onboardingBackground.color
navigationActionView.backgroundColor = Asset.Scene.Onboarding.background.color
navigationActionView.backButton.setTitle(L10n.Common.Controls.Actions.skip, for: .normal)
return navigationActionView
}()

View File

@ -20,7 +20,7 @@ extension PollOptionView {
.receive(on: DispatchQueue.main)
.sink { [weak self] theme in
guard let self = self else { return }
self.viewModel.roundedBackgroundViewColor = theme.secondarySystemBackgroundColor
self.viewModel.roundedBackgroundViewColor = theme.systemElevatedBackgroundColor
}
.store(in: &disposeBag)
// metaContent

View File

@ -0,0 +1,9 @@
{
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"provides-namespace" : true
}
}

View File

@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.969",
"green" : "0.949",
"red" : "0.949"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.129",
"green" : "0.106",
"red" : "0.098"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -5,9 +5,9 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.910",
"green" : "0.882",
"red" : "0.851"
"blue" : "0xF7",
"green" : "0xF2",
"red" : "0xF2"
}
},
"idiom" : "universal"

View File

@ -5,9 +5,9 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "1.000",
"green" : "1.000",
"red" : "1.000"
"blue" : "0xF2",
"green" : "0xED",
"red" : "0xE9"
}
},
"idiom" : "universal"

View File

@ -5,9 +5,9 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.910",
"green" : "0.882",
"red" : "0.851"
"blue" : "0xF7",
"green" : "0xF2",
"red" : "0xF2"
}
},
"idiom" : "universal"

View File

@ -5,9 +5,9 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.910",
"green" : "0.882",
"red" : "0.851"
"blue" : "0xF7",
"green" : "0xF2",
"red" : "0xF2"
}
},
"idiom" : "universal"

View File

@ -5,9 +5,9 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.996",
"green" : "1.000",
"red" : "0.996"
"blue" : "254",
"green" : "255",
"red" : "254"
}
},
"idiom" : "universal"
@ -23,9 +23,9 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.180",
"green" : "0.173",
"red" : "0.173"
"blue" : "0x2D",
"green" : "0x2C",
"red" : "0x2C"
}
},
"idiom" : "universal"

View File

@ -5,9 +5,9 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.910",
"green" : "0.878",
"red" : "0.851"
"blue" : "0xF7",
"green" : "0xF2",
"red" : "0xF2"
}
},
"idiom" : "universal"
@ -23,9 +23,9 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.180",
"green" : "0.173",
"red" : "0.173"
"blue" : "0x2D",
"green" : "0x2C",
"red" : "0x2C"
}
},
"idiom" : "universal"

View File

@ -23,9 +23,9 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.000",
"green" : "0.000",
"red" : "0.000"
"blue" : "0x00",
"green" : "0x00",
"red" : "0x00"
}
},
"idiom" : "universal"

View File

@ -5,9 +5,9 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "1.000",
"green" : "1.000",
"red" : "1.000"
"blue" : "0xF2",
"green" : "0xED",
"red" : "0xE9"
}
},
"idiom" : "universal"
@ -23,9 +23,9 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.118",
"green" : "0.110",
"red" : "0.110"
"blue" : "30",
"green" : "28",
"red" : "28"
}
},
"idiom" : "universal"

View File

@ -5,9 +5,9 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.910",
"green" : "0.878",
"red" : "0.851"
"blue" : "0xF7",
"green" : "0xF2",
"red" : "0xF2"
}
},
"idiom" : "universal"

View File

@ -5,9 +5,9 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.910",
"green" : "0.882",
"red" : "0.851"
"blue" : "0xF7",
"green" : "0xF2",
"red" : "0xF2"
}
},
"idiom" : "universal"

View File

@ -105,11 +105,11 @@ public enum Asset {
public enum Scene {
public enum Onboarding {
public static let avatarPlaceholder = ImageAsset(name: "Scene/Onboarding/avatar.placeholder")
public static let background = ColorAsset(name: "Scene/Onboarding/background")
public static let navigationBackButtonBackground = ColorAsset(name: "Scene/Onboarding/navigation.back.button.background")
public static let navigationBackButtonBackgroundHighlighted = ColorAsset(name: "Scene/Onboarding/navigation.back.button.background.highlighted")
public static let navigationNextButtonBackground = ColorAsset(name: "Scene/Onboarding/navigation.next.button.background")
public static let navigationNextButtonBackgroundHighlighted = ColorAsset(name: "Scene/Onboarding/navigation.next.button.background.highlighted")
public static let onboardingBackground = ColorAsset(name: "Scene/Onboarding/onboarding.background")
public static let searchBarBackground = ColorAsset(name: "Scene/Onboarding/search.bar.background")
public static let textFieldBackground = ColorAsset(name: "Scene/Onboarding/textField.background")
}
@ -128,6 +128,9 @@ public enum Asset {
public static let background = ColorAsset(name: "Scene/Report/background")
public static let reportBanner = ColorAsset(name: "Scene/Report/report.banner")
}
public enum Setting {
public static let background = ColorAsset(name: "Scene/Setting/background")
}
public enum Sidebar {
public static let logo = ImageAsset(name: "Scene/Sidebar/logo")
}

View File

@ -103,6 +103,7 @@ public final class NotificationView: UIView {
public let statusView = StatusView()
public let quoteStatusViewContainerView = UIView()
public let quoteBackgroundView = UIView()
public let quoteStatusView = StatusView()
public func prepareForReuse() {
@ -232,7 +233,6 @@ extension NotificationView {
right: StatusView.containerLayoutMargin.right
)
let quoteBackgroundView = UIView()
quoteBackgroundView.layoutMargins = UIEdgeInsets(top: 16, left: 0, bottom: 0, right: 0)
quoteBackgroundView.translatesAutoresizingMaskIntoConstraints = false