fix: using wrong color issue
This commit is contained in:
parent
a07104053c
commit
af42540ee7
|
@ -9,7 +9,7 @@ import UIKit
|
||||||
import CoreData
|
import CoreData
|
||||||
|
|
||||||
enum SettingsItem: Hashable {
|
enum SettingsItem: Hashable {
|
||||||
case apperance(settingObjectID: NSManagedObjectID)
|
case appearance(settingObjectID: NSManagedObjectID)
|
||||||
case notification(settingObjectID: NSManagedObjectID, switchMode: NotificationSwitchMode)
|
case notification(settingObjectID: NSManagedObjectID, switchMode: NotificationSwitchMode)
|
||||||
case boringZone(item: Link)
|
case boringZone(item: Link)
|
||||||
case spicyZone(item: Link)
|
case spicyZone(item: Link)
|
||||||
|
@ -56,8 +56,8 @@ extension SettingsItem {
|
||||||
|
|
||||||
var textColor: UIColor {
|
var textColor: UIColor {
|
||||||
switch self {
|
switch self {
|
||||||
case .termsOfService: return .systemBlue
|
case .termsOfService: return Asset.Colors.brandBlue.color
|
||||||
case .privacyPolicy: return .systemBlue
|
case .privacyPolicy: return Asset.Colors.brandBlue.color
|
||||||
case .clearMediaCache: return .systemRed
|
case .clearMediaCache: return .systemRed
|
||||||
case .signOut: return .systemRed
|
case .signOut: return .systemRed
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,7 +91,7 @@ extension PollSection {
|
||||||
cell.pollOptionView.optionPercentageLabel.isHidden = false
|
cell.pollOptionView.optionPercentageLabel.isHidden = false
|
||||||
cell.pollOptionView.optionPercentageLabel.text = String(Int(100 * percentage)) + "%"
|
cell.pollOptionView.optionPercentageLabel.text = String(Int(100 * percentage)) + "%"
|
||||||
cell.pollOptionView.voteProgressStripView.isHidden = false
|
cell.pollOptionView.voteProgressStripView.isHidden = false
|
||||||
cell.pollOptionView.voteProgressStripView.tintColor = voted ? Asset.Colors.Background.Poll.highlight.color : Asset.Colors.Background.Poll.disabled.color
|
cell.pollOptionView.voteProgressStripView.tintColor = voted ? Asset.Colors.brandBlue.color : Asset.Colors.Background.Poll.disabled.color
|
||||||
cell.pollOptionView.voteProgressStripView.setProgress(CGFloat(percentage), animated: animated)
|
cell.pollOptionView.voteProgressStripView.setProgress(CGFloat(percentage), animated: animated)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,9 +25,9 @@ extension ActiveLabel {
|
||||||
|
|
||||||
numberOfLines = 0
|
numberOfLines = 0
|
||||||
lineSpacing = 5
|
lineSpacing = 5
|
||||||
mentionColor = Asset.Colors.Label.highlight.color
|
mentionColor = Asset.Colors.brandBlue.color
|
||||||
hashtagColor = Asset.Colors.Label.highlight.color
|
hashtagColor = Asset.Colors.brandBlue.color
|
||||||
URLColor = Asset.Colors.Label.highlight.color
|
URLColor = Asset.Colors.brandBlue.color
|
||||||
emojiPlaceholderColor = .systemFill
|
emojiPlaceholderColor = .systemFill
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
|
text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
|
||||||
|
|
|
@ -33,7 +33,7 @@ extension UITableView {
|
||||||
let backgroundColor = cell.backgroundColor
|
let backgroundColor = cell.backgroundColor
|
||||||
|
|
||||||
UIView.animate(withDuration: 0.3) {
|
UIView.animate(withDuration: 0.3) {
|
||||||
cell.backgroundColor = Asset.Colors.Label.highlight.color.withAlphaComponent(0.5)
|
cell.backgroundColor = Asset.Colors.brandBlue.color.withAlphaComponent(0.5)
|
||||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
|
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
|
||||||
UIView.animate(withDuration: 0.3) {
|
UIView.animate(withDuration: 0.3) {
|
||||||
cell.backgroundColor = backgroundColor
|
cell.backgroundColor = backgroundColor
|
||||||
|
|
|
@ -32,12 +32,8 @@ internal enum Asset {
|
||||||
}
|
}
|
||||||
internal enum Colors {
|
internal enum Colors {
|
||||||
internal enum Background {
|
internal enum Background {
|
||||||
internal enum AudioPlayer {
|
|
||||||
internal static let highlight = ColorAsset(name: "Colors/Background/AudioPlayer/highlight")
|
|
||||||
}
|
|
||||||
internal enum Poll {
|
internal enum Poll {
|
||||||
internal static let disabled = ColorAsset(name: "Colors/Background/Poll/disabled")
|
internal static let disabled = ColorAsset(name: "Colors/Background/Poll/disabled")
|
||||||
internal static let highlight = ColorAsset(name: "Colors/Background/Poll/highlight")
|
|
||||||
}
|
}
|
||||||
internal static let alertYellow = ColorAsset(name: "Colors/Background/alert.yellow")
|
internal static let alertYellow = ColorAsset(name: "Colors/Background/alert.yellow")
|
||||||
internal static let dangerBorder = ColorAsset(name: "Colors/Background/danger.border")
|
internal static let dangerBorder = ColorAsset(name: "Colors/Background/danger.border")
|
||||||
|
@ -61,13 +57,11 @@ internal enum Asset {
|
||||||
internal static let actionToolbar = ColorAsset(name: "Colors/Button/action.toolbar")
|
internal static let actionToolbar = ColorAsset(name: "Colors/Button/action.toolbar")
|
||||||
internal static let disabled = ColorAsset(name: "Colors/Button/disabled")
|
internal static let disabled = ColorAsset(name: "Colors/Button/disabled")
|
||||||
internal static let inactive = ColorAsset(name: "Colors/Button/inactive")
|
internal static let inactive = ColorAsset(name: "Colors/Button/inactive")
|
||||||
internal static let normal = ColorAsset(name: "Colors/Button/normal")
|
|
||||||
}
|
}
|
||||||
internal enum Icon {
|
internal enum Icon {
|
||||||
internal static let plus = ColorAsset(name: "Colors/Icon/plus")
|
internal static let plus = ColorAsset(name: "Colors/Icon/plus")
|
||||||
}
|
}
|
||||||
internal enum Label {
|
internal enum Label {
|
||||||
internal static let highlight = ColorAsset(name: "Colors/Label/highlight")
|
|
||||||
internal static let primary = ColorAsset(name: "Colors/Label/primary")
|
internal static let primary = ColorAsset(name: "Colors/Label/primary")
|
||||||
internal static let secondary = ColorAsset(name: "Colors/Label/secondary")
|
internal static let secondary = ColorAsset(name: "Colors/Label/secondary")
|
||||||
internal static let tertiary = ColorAsset(name: "Colors/Label/tertiary")
|
internal static let tertiary = ColorAsset(name: "Colors/Label/tertiary")
|
||||||
|
@ -85,7 +79,6 @@ internal enum Asset {
|
||||||
}
|
}
|
||||||
internal enum TextField {
|
internal enum TextField {
|
||||||
internal static let background = ColorAsset(name: "Colors/TextField/background")
|
internal static let background = ColorAsset(name: "Colors/TextField/background")
|
||||||
internal static let highlight = ColorAsset(name: "Colors/TextField/highlight")
|
|
||||||
internal static let invalid = ColorAsset(name: "Colors/TextField/invalid")
|
internal static let invalid = ColorAsset(name: "Colors/TextField/invalid")
|
||||||
internal static let valid = ColorAsset(name: "Colors/TextField/valid")
|
internal static let valid = ColorAsset(name: "Colors/TextField/valid")
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
"info" : {
|
|
||||||
"author" : "xcode",
|
|
||||||
"version" : 1
|
|
||||||
},
|
|
||||||
"properties" : {
|
|
||||||
"provides-namespace" : true
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,20 +0,0 @@
|
||||||
{
|
|
||||||
"colors" : [
|
|
||||||
{
|
|
||||||
"color" : {
|
|
||||||
"color-space" : "srgb",
|
|
||||||
"components" : {
|
|
||||||
"alpha" : "1.000",
|
|
||||||
"blue" : "0.851",
|
|
||||||
"green" : "0.565",
|
|
||||||
"red" : "0.169"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"idiom" : "universal"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"info" : {
|
|
||||||
"author" : "xcode",
|
|
||||||
"version" : 1
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,20 +0,0 @@
|
||||||
{
|
|
||||||
"colors" : [
|
|
||||||
{
|
|
||||||
"color" : {
|
|
||||||
"color-space" : "srgb",
|
|
||||||
"components" : {
|
|
||||||
"alpha" : "1.000",
|
|
||||||
"blue" : "0.851",
|
|
||||||
"green" : "0.565",
|
|
||||||
"red" : "0.169"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"idiom" : "universal"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"info" : {
|
|
||||||
"author" : "xcode",
|
|
||||||
"version" : 1
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,38 +0,0 @@
|
||||||
{
|
|
||||||
"colors" : [
|
|
||||||
{
|
|
||||||
"color" : {
|
|
||||||
"color-space" : "srgb",
|
|
||||||
"components" : {
|
|
||||||
"alpha" : "1.000",
|
|
||||||
"blue" : "0xD9",
|
|
||||||
"green" : "0x90",
|
|
||||||
"red" : "0x2B"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"idiom" : "universal"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"appearances" : [
|
|
||||||
{
|
|
||||||
"appearance" : "luminosity",
|
|
||||||
"value" : "dark"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"color" : {
|
|
||||||
"color-space" : "srgb",
|
|
||||||
"components" : {
|
|
||||||
"alpha" : "1.000",
|
|
||||||
"blue" : "0xFF",
|
|
||||||
"green" : "0x84",
|
|
||||||
"red" : "0x0A"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"idiom" : "universal"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"info" : {
|
|
||||||
"author" : "xcode",
|
|
||||||
"version" : 1
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,20 +0,0 @@
|
||||||
{
|
|
||||||
"colors" : [
|
|
||||||
{
|
|
||||||
"color" : {
|
|
||||||
"color-space" : "srgb",
|
|
||||||
"components" : {
|
|
||||||
"alpha" : "1.000",
|
|
||||||
"blue" : "217",
|
|
||||||
"green" : "144",
|
|
||||||
"red" : "43"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"idiom" : "universal"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"info" : {
|
|
||||||
"author" : "xcode",
|
|
||||||
"version" : 1
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,20 +0,0 @@
|
||||||
{
|
|
||||||
"colors" : [
|
|
||||||
{
|
|
||||||
"color" : {
|
|
||||||
"color-space" : "srgb",
|
|
||||||
"components" : {
|
|
||||||
"alpha" : "1.000",
|
|
||||||
"blue" : "217",
|
|
||||||
"green" : "144",
|
|
||||||
"red" : "43"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"idiom" : "universal"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"info" : {
|
|
||||||
"author" : "xcode",
|
|
||||||
"version" : 1
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -32,7 +32,7 @@ final class AutoCompleteTableViewCell: UITableViewCell {
|
||||||
let titleLabel: UILabel = {
|
let titleLabel: UILabel = {
|
||||||
let label = UILabel()
|
let label = UILabel()
|
||||||
label.font = UIFontMetrics(forTextStyle: .headline).scaledFont(for: .systemFont(ofSize: 17, weight: .semibold), maximumPointSize: 22)
|
label.font = UIFontMetrics(forTextStyle: .headline).scaledFont(for: .systemFont(ofSize: 17, weight: .semibold), maximumPointSize: 22)
|
||||||
label.textColor = Asset.Colors.Label.highlight.color
|
label.textColor = Asset.Colors.brandBlue.color
|
||||||
label.text = "Title"
|
label.text = "Title"
|
||||||
return label
|
return label
|
||||||
}()
|
}()
|
||||||
|
|
|
@ -23,7 +23,7 @@ final class ComposeStatusPollExpiresOptionCollectionViewCell: UICollectionViewCe
|
||||||
button.titleLabel?.font = UIFontMetrics(forTextStyle: .body).scaledFont(for: .systemFont(ofSize: 12))
|
button.titleLabel?.font = UIFontMetrics(forTextStyle: .body).scaledFont(for: .systemFont(ofSize: 12))
|
||||||
button.expandEdgeInsets = UIEdgeInsets(top: 0, left: -10, bottom: -20, right: -20)
|
button.expandEdgeInsets = UIEdgeInsets(top: 0, left: -10, bottom: -20, right: -20)
|
||||||
button.setTitle(L10n.Scene.Compose.Poll.durationTime(L10n.Scene.Compose.Poll.thirtyMinutes), for: .normal)
|
button.setTitle(L10n.Scene.Compose.Poll.durationTime(L10n.Scene.Compose.Poll.thirtyMinutes), for: .normal)
|
||||||
button.setTitleColor(Asset.Colors.Button.normal.color, for: .normal)
|
button.setTitleColor(Asset.Colors.brandBlue.color, for: .normal)
|
||||||
return button
|
return button
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ final class ComposeStatusPollOptionAppendEntryCollectionViewCell: UICollectionVi
|
||||||
override var isHighlighted: Bool {
|
override var isHighlighted: Bool {
|
||||||
didSet {
|
didSet {
|
||||||
pollOptionView.roundedBackgroundView.backgroundColor = isHighlighted ? Asset.Colors.Background.tertiarySystemBackground.color : Asset.Colors.Background.secondarySystemBackground.color
|
pollOptionView.roundedBackgroundView.backgroundColor = isHighlighted ? Asset.Colors.Background.tertiarySystemBackground.color : Asset.Colors.Background.secondarySystemBackground.color
|
||||||
pollOptionView.plusCircleImageView.tintColor = isHighlighted ? Asset.Colors.Button.normal.color.withAlphaComponent(0.5) : Asset.Colors.Button.normal.color
|
pollOptionView.plusCircleImageView.tintColor = isHighlighted ? Asset.Colors.brandBlue.color.withAlphaComponent(0.5) : Asset.Colors.brandBlue.color
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,8 +29,8 @@ final class ComposeViewController: UIViewController, NeedsDependency {
|
||||||
let button = RoundedEdgesButton(type: .custom)
|
let button = RoundedEdgesButton(type: .custom)
|
||||||
button.setTitle(L10n.Scene.Compose.composeAction, for: .normal)
|
button.setTitle(L10n.Scene.Compose.composeAction, for: .normal)
|
||||||
button.titleLabel?.font = .systemFont(ofSize: 14, weight: .bold)
|
button.titleLabel?.font = .systemFont(ofSize: 14, weight: .bold)
|
||||||
button.setBackgroundImage(.placeholder(color: Asset.Colors.Button.normal.color), for: .normal)
|
button.setBackgroundImage(.placeholder(color: Asset.Colors.brandBlue.color), for: .normal)
|
||||||
button.setBackgroundImage(.placeholder(color: Asset.Colors.Button.normal.color.withAlphaComponent(0.5)), for: .highlighted)
|
button.setBackgroundImage(.placeholder(color: Asset.Colors.brandBlue.color.withAlphaComponent(0.5)), for: .highlighted)
|
||||||
button.setBackgroundImage(.placeholder(color: Asset.Colors.Button.disabled.color), for: .disabled)
|
button.setBackgroundImage(.placeholder(color: Asset.Colors.Button.disabled.color), for: .disabled)
|
||||||
button.setTitleColor(.white, for: .normal)
|
button.setTitleColor(.white, for: .normal)
|
||||||
button.contentEdgeInsets = UIEdgeInsets(top: 6, left: 16, bottom: 5, right: 16) // set 28pt height
|
button.contentEdgeInsets = UIEdgeInsets(top: 6, left: 16, bottom: 5, right: 16) // set 28pt height
|
||||||
|
@ -711,7 +711,7 @@ extension ComposeViewController: TextEditorViewTextAttributesDelegate {
|
||||||
for match in highlightMatches {
|
for match in highlightMatches {
|
||||||
// set highlight
|
// set highlight
|
||||||
var attributes = [NSAttributedString.Key: Any]()
|
var attributes = [NSAttributedString.Key: Any]()
|
||||||
attributes[.foregroundColor] = Asset.Colors.Label.highlight.color
|
attributes[.foregroundColor] = Asset.Colors.brandBlue.color
|
||||||
|
|
||||||
// See `traitCollectionDidChange(_:)`
|
// See `traitCollectionDidChange(_:)`
|
||||||
// set accessibility
|
// set accessibility
|
||||||
|
@ -780,7 +780,7 @@ extension ComposeViewController: TextEditorViewTextAttributesDelegate {
|
||||||
|
|
||||||
// set highlight
|
// set highlight
|
||||||
var attributes = [NSAttributedString.Key: Any]()
|
var attributes = [NSAttributedString.Key: Any]()
|
||||||
attributes[.foregroundColor] = Asset.Colors.Label.highlight.color
|
attributes[.foregroundColor] = Asset.Colors.brandBlue.color
|
||||||
|
|
||||||
// See `traitCollectionDidChange(_:)`
|
// See `traitCollectionDidChange(_:)`
|
||||||
// set accessibility
|
// set accessibility
|
||||||
|
|
|
@ -225,7 +225,7 @@ extension ComposeToolbarView {
|
||||||
extension ComposeToolbarView {
|
extension ComposeToolbarView {
|
||||||
|
|
||||||
private static func configureToolbarButtonAppearance(button: UIButton) {
|
private static func configureToolbarButtonAppearance(button: UIButton) {
|
||||||
button.tintColor = Asset.Colors.Button.normal.color
|
button.tintColor = Asset.Colors.brandBlue.color
|
||||||
button.setBackgroundImage(.placeholder(size: ComposeToolbarView.toolbarButtonSize, color: .systemFill), for: .highlighted)
|
button.setBackgroundImage(.placeholder(size: ComposeToolbarView.toolbarButtonSize, color: .systemFill), for: .highlighted)
|
||||||
button.layer.masksToBounds = true
|
button.layer.masksToBounds = true
|
||||||
button.layer.cornerRadius = 5
|
button.layer.cornerRadius = 5
|
||||||
|
|
|
@ -106,7 +106,7 @@ extension HomeTimelineNavigationBarTitleView {
|
||||||
configureButton(
|
configureButton(
|
||||||
title: L10n.Scene.HomeTimeline.NavigationBarState.newPosts,
|
title: L10n.Scene.HomeTimeline.NavigationBarState.newPosts,
|
||||||
textColor: .white,
|
textColor: .white,
|
||||||
backgroundColor: Asset.Colors.Button.normal.color
|
backgroundColor: Asset.Colors.brandBlue.color
|
||||||
)
|
)
|
||||||
button.isHidden = false
|
button.isHidden = false
|
||||||
case .offlineButton:
|
case .offlineButton:
|
||||||
|
|
|
@ -713,7 +713,7 @@ extension MastodonRegisterViewController: UITextFieldDelegate {
|
||||||
private func setTextFieldValidAppearance(_ textField: UITextField, validateState: MastodonRegisterViewModel.ValidateState) {
|
private func setTextFieldValidAppearance(_ textField: UITextField, validateState: MastodonRegisterViewModel.ValidateState) {
|
||||||
switch validateState {
|
switch validateState {
|
||||||
case .empty:
|
case .empty:
|
||||||
showShadowWithColor(color: textField.isFirstResponder ? Asset.Colors.TextField.highlight.color : .clear, textField: textField)
|
showShadowWithColor(color: textField.isFirstResponder ? Asset.Colors.brandBlue.color : .clear, textField: textField)
|
||||||
case .valid:
|
case .valid:
|
||||||
showShadowWithColor(color: Asset.Colors.TextField.valid.color, textField: textField)
|
showShadowWithColor(color: Asset.Colors.TextField.valid.color, textField: textField)
|
||||||
case .invalid:
|
case .invalid:
|
||||||
|
|
|
@ -175,15 +175,19 @@ extension MastodonServerRulesViewController {
|
||||||
}
|
}
|
||||||
|
|
||||||
func configTextView() {
|
func configTextView() {
|
||||||
let linkColor = Asset.Colors.Button.normal.color
|
|
||||||
|
|
||||||
let str = NSString(string: L10n.Scene.ServerRules.prompt(viewModel.domain))
|
let str = NSString(string: L10n.Scene.ServerRules.prompt(viewModel.domain))
|
||||||
let termsOfServiceRange = str.range(of: L10n.Scene.ServerRules.termsOfService)
|
let termsOfServiceRange = str.range(of: L10n.Scene.ServerRules.termsOfService)
|
||||||
let privacyRange = str.range(of: L10n.Scene.ServerRules.privacyPolicy)
|
let privacyRange = str.range(of: L10n.Scene.ServerRules.privacyPolicy)
|
||||||
let attributeString = NSMutableAttributedString(string: L10n.Scene.ServerRules.prompt(viewModel.domain), attributes: [NSAttributedString.Key.font: UIFontMetrics(forTextStyle: .body).scaledFont(for: .systemFont(ofSize: 17, weight: .regular), maximumPointSize: 22), NSAttributedString.Key.foregroundColor: UIColor.label])
|
let attributeString = NSMutableAttributedString(
|
||||||
|
string: L10n.Scene.ServerRules.prompt(viewModel.domain),
|
||||||
|
attributes: [
|
||||||
|
NSAttributedString.Key.font: UIFontMetrics(forTextStyle: .body).scaledFont(for: .systemFont(ofSize: 17, weight: .regular), maximumPointSize: 22),
|
||||||
|
NSAttributedString.Key.foregroundColor: UIColor.label
|
||||||
|
]
|
||||||
|
)
|
||||||
attributeString.addAttribute(.link, value: Mastodon.API.serverRulesURL(domain: viewModel.domain), range: termsOfServiceRange)
|
attributeString.addAttribute(.link, value: Mastodon.API.serverRulesURL(domain: viewModel.domain), range: termsOfServiceRange)
|
||||||
attributeString.addAttribute(.link, value: Mastodon.API.privacyURL(domain: viewModel.domain), range: privacyRange)
|
attributeString.addAttribute(.link, value: Mastodon.API.privacyURL(domain: viewModel.domain), range: privacyRange)
|
||||||
let linkAttributes = [NSAttributedString.Key.foregroundColor:linkColor]
|
let linkAttributes = [NSAttributedString.Key.foregroundColor: Asset.Colors.brandBlue.color]
|
||||||
bottomPromptTextView.attributedText = attributeString
|
bottomPromptTextView.attributedText = attributeString
|
||||||
bottomPromptTextView.linkTextAttributes = linkAttributes
|
bottomPromptTextView.linkTextAttributes = linkAttributes
|
||||||
bottomPromptTextView.delegate = self
|
bottomPromptTextView.delegate = self
|
||||||
|
|
|
@ -41,7 +41,7 @@ final class WelcomeViewController: UIViewController, NeedsDependency {
|
||||||
let backgroundImageHighlightedColor: UIColor = traitCollection.userInterfaceIdiom == .phone ? UIColor(white: 0.8, alpha: 1.0) : Asset.Colors.brandBlueDarken20.color
|
let backgroundImageHighlightedColor: UIColor = traitCollection.userInterfaceIdiom == .phone ? UIColor(white: 0.8, alpha: 1.0) : Asset.Colors.brandBlueDarken20.color
|
||||||
button.setBackgroundImage(.placeholder(color: backgroundImageColor), for: .normal)
|
button.setBackgroundImage(.placeholder(color: backgroundImageColor), for: .normal)
|
||||||
button.setBackgroundImage(.placeholder(color: backgroundImageHighlightedColor), for: .highlighted)
|
button.setBackgroundImage(.placeholder(color: backgroundImageHighlightedColor), for: .highlighted)
|
||||||
let titleColor: UIColor = traitCollection.userInterfaceIdiom == .phone ? Asset.Colors.Button.normal.color : UIColor.white
|
let titleColor: UIColor = traitCollection.userInterfaceIdiom == .phone ? Asset.Colors.brandBlue.color : UIColor.white
|
||||||
button.setTitleColor(titleColor, for: .normal)
|
button.setTitleColor(titleColor, for: .normal)
|
||||||
button.translatesAutoresizingMaskIntoConstraints = false
|
button.translatesAutoresizingMaskIntoConstraints = false
|
||||||
return button
|
return button
|
||||||
|
@ -51,7 +51,7 @@ final class WelcomeViewController: UIViewController, NeedsDependency {
|
||||||
let button = UIButton(type: .system)
|
let button = UIButton(type: .system)
|
||||||
button.titleLabel?.font = UIFontMetrics(forTextStyle: .headline).scaledFont(for: .systemFont(ofSize: 15, weight: .semibold))
|
button.titleLabel?.font = UIFontMetrics(forTextStyle: .headline).scaledFont(for: .systemFont(ofSize: 15, weight: .semibold))
|
||||||
button.setTitle(L10n.Common.Controls.Actions.signIn, for: .normal)
|
button.setTitle(L10n.Common.Controls.Actions.signIn, for: .normal)
|
||||||
let titleColor: UIColor = traitCollection.userInterfaceIdiom == .phone ? UIColor.white.withAlphaComponent(0.8) : Asset.Colors.Button.normal.color
|
let titleColor: UIColor = traitCollection.userInterfaceIdiom == .phone ? UIColor.white.withAlphaComponent(0.8) : Asset.Colors.brandBlue.color
|
||||||
button.setTitleColor(titleColor, for: .normal)
|
button.setTitleColor(titleColor, for: .normal)
|
||||||
button.translatesAutoresizingMaskIntoConstraints = false
|
button.translatesAutoresizingMaskIntoConstraints = false
|
||||||
return button
|
return button
|
||||||
|
|
|
@ -395,21 +395,21 @@ extension ProfileViewModel {
|
||||||
var backgroundColor: UIColor {
|
var backgroundColor: UIColor {
|
||||||
guard let highPriorityAction = self.highPriorityAction(except: []) else {
|
guard let highPriorityAction = self.highPriorityAction(except: []) else {
|
||||||
assertionFailure()
|
assertionFailure()
|
||||||
return Asset.Colors.Button.normal.color
|
return Asset.Colors.brandBlue.color
|
||||||
}
|
}
|
||||||
switch highPriorityAction {
|
switch highPriorityAction {
|
||||||
case .none: return Asset.Colors.Button.normal.color
|
case .none: return Asset.Colors.brandBlue.color
|
||||||
case .follow: return Asset.Colors.Button.normal.color
|
case .follow: return Asset.Colors.brandBlue.color
|
||||||
case .reqeust: return Asset.Colors.Button.normal.color
|
case .reqeust: return Asset.Colors.brandBlue.color
|
||||||
case .pending: return Asset.Colors.Button.normal.color
|
case .pending: return Asset.Colors.brandBlue.color
|
||||||
case .following: return Asset.Colors.Button.normal.color
|
case .following: return Asset.Colors.brandBlue.color
|
||||||
case .muting: return Asset.Colors.Background.alertYellow.color
|
case .muting: return Asset.Colors.Background.alertYellow.color
|
||||||
case .blocked: return Asset.Colors.Button.normal.color
|
case .blocked: return Asset.Colors.brandBlue.color
|
||||||
case .blocking: return Asset.Colors.Background.danger.color
|
case .blocking: return Asset.Colors.Background.danger.color
|
||||||
case .suspended: return Asset.Colors.Button.normal.color
|
case .suspended: return Asset.Colors.brandBlue.color
|
||||||
case .edit: return Asset.Colors.Button.normal.color
|
case .edit: return Asset.Colors.brandBlue.color
|
||||||
case .editing: return Asset.Colors.Button.normal.color
|
case .editing: return Asset.Colors.brandBlue.color
|
||||||
case .updating: return Asset.Colors.Button.normal.color
|
case .updating: return Asset.Colors.brandBlue.color
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -241,7 +241,7 @@ class ReportViewController: UIViewController, NeedsDependency {
|
||||||
= UIBarButtonItem(barButtonSystemItem: UIBarButtonItem.SystemItem.cancel,
|
= UIBarButtonItem(barButtonSystemItem: UIBarButtonItem.SystemItem.cancel,
|
||||||
target: self,
|
target: self,
|
||||||
action: #selector(doneButtonDidClick))
|
action: #selector(doneButtonDidClick))
|
||||||
navigationItem.rightBarButtonItem?.tintColor = Asset.Colors.Label.highlight.color
|
navigationItem.rightBarButtonItem?.tintColor = Asset.Colors.brandBlue.color
|
||||||
|
|
||||||
// fetch old mastodon user
|
// fetch old mastodon user
|
||||||
let beReportedUser: MastodonUser? = {
|
let beReportedUser: MastodonUser? = {
|
||||||
|
|
|
@ -76,7 +76,7 @@ final class ReportedStatusTableViewCell: UITableViewCell, StatusCell {
|
||||||
super.setHighlighted(highlighted, animated: animated)
|
super.setHighlighted(highlighted, animated: animated)
|
||||||
if highlighted {
|
if highlighted {
|
||||||
checkbox.image = UIImage(systemName: "checkmark.circle.fill")
|
checkbox.image = UIImage(systemName: "checkmark.circle.fill")
|
||||||
checkbox.tintColor = Asset.Colors.Label.highlight.color
|
checkbox.tintColor = Asset.Colors.brandBlue.color
|
||||||
} else if !isSelected {
|
} else if !isSelected {
|
||||||
checkbox.image = UIImage(systemName: "circle")
|
checkbox.image = UIImage(systemName: "circle")
|
||||||
checkbox.tintColor = Asset.Colors.Label.secondary.color
|
checkbox.tintColor = Asset.Colors.Label.secondary.color
|
||||||
|
|
|
@ -328,7 +328,7 @@ extension SettingsViewController: UITableViewDelegate {
|
||||||
guard let item = dataSource.itemIdentifier(for: indexPath) else { return }
|
guard let item = dataSource.itemIdentifier(for: indexPath) else { return }
|
||||||
|
|
||||||
switch item {
|
switch item {
|
||||||
case .apperance:
|
case .appearance:
|
||||||
// do nothing
|
// do nothing
|
||||||
break
|
break
|
||||||
case .notification:
|
case .notification:
|
||||||
|
@ -399,7 +399,7 @@ extension SettingsViewController: SettingsAppearanceTableViewCellDelegate {
|
||||||
guard let dataSource = viewModel.dataSource else { return }
|
guard let dataSource = viewModel.dataSource else { return }
|
||||||
guard let indexPath = tableView.indexPath(for: cell) else { return }
|
guard let indexPath = tableView.indexPath(for: cell) else { return }
|
||||||
let item = dataSource.itemIdentifier(for: indexPath)
|
let item = dataSource.itemIdentifier(for: indexPath)
|
||||||
guard case let .apperance(settingObjectID) = item else { return }
|
guard case let .appearance(settingObjectID) = item else { return }
|
||||||
|
|
||||||
context.managedObjectContext.performChanges {
|
context.managedObjectContext.performChanges {
|
||||||
let setting = self.context.managedObjectContext.object(with: settingObjectID) as! Setting
|
let setting = self.context.managedObjectContext.object(with: settingObjectID) as! Setting
|
||||||
|
|
|
@ -71,7 +71,7 @@ extension SettingsViewModel {
|
||||||
var snapshot = NSDiffableDataSourceSnapshot<SettingsSection, SettingsItem>()
|
var snapshot = NSDiffableDataSourceSnapshot<SettingsSection, SettingsItem>()
|
||||||
|
|
||||||
// appearance
|
// appearance
|
||||||
let appearanceItems = [SettingsItem.apperance(settingObjectID: setting.objectID)]
|
let appearanceItems = [SettingsItem.appearance(settingObjectID: setting.objectID)]
|
||||||
snapshot.appendSections([.apperance])
|
snapshot.appendSections([.apperance])
|
||||||
snapshot.appendItems(appearanceItems, toSection: .apperance)
|
snapshot.appendItems(appearanceItems, toSection: .apperance)
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ extension SettingsViewModel {
|
||||||
guard let self = self else { return nil }
|
guard let self = self else { return nil }
|
||||||
|
|
||||||
switch item {
|
switch item {
|
||||||
case .apperance(let objectID):
|
case .appearance(let objectID):
|
||||||
let cell = tableView.dequeueReusableCell(withIdentifier: String(describing: SettingsAppearanceTableViewCell.self), for: indexPath) as! SettingsAppearanceTableViewCell
|
let cell = tableView.dequeueReusableCell(withIdentifier: String(describing: SettingsAppearanceTableViewCell.self), for: indexPath) as! SettingsAppearanceTableViewCell
|
||||||
self.context.managedObjectContext.performAndWait {
|
self.context.managedObjectContext.performAndWait {
|
||||||
let setting = self.context.managedObjectContext.object(with: objectID) as! Setting
|
let setting = self.context.managedObjectContext.object(with: objectID) as! Setting
|
||||||
|
|
|
@ -48,7 +48,7 @@ class AppearanceView: UIView {
|
||||||
didSet {
|
didSet {
|
||||||
checkBox.isSelected = selected
|
checkBox.isSelected = selected
|
||||||
if selected {
|
if selected {
|
||||||
checkBox.imageView?.tintColor = Asset.Colors.Label.highlight.color
|
checkBox.imageView?.tintColor = Asset.Colors.brandBlue.color
|
||||||
} else {
|
} else {
|
||||||
checkBox.imageView?.tintColor = Asset.Colors.Label.secondary.color
|
checkBox.imageView?.tintColor = Asset.Colors.Label.secondary.color
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,10 +38,20 @@ extension PrimaryActionButton {
|
||||||
private func _init() {
|
private func _init() {
|
||||||
titleLabel?.font = UIFontMetrics(forTextStyle: .headline).scaledFont(for: .systemFont(ofSize: 17, weight: .semibold))
|
titleLabel?.font = UIFontMetrics(forTextStyle: .headline).scaledFont(for: .systemFont(ofSize: 17, weight: .semibold))
|
||||||
setTitleColor(.white, for: .normal)
|
setTitleColor(.white, for: .normal)
|
||||||
|
setupBackgroundAppearance()
|
||||||
|
applyCornerRadius(radius: 10)
|
||||||
|
}
|
||||||
|
|
||||||
|
func setupBackgroundAppearance() {
|
||||||
setBackgroundImage(UIImage.placeholder(color: Asset.Colors.brandBlue.color), for: .normal)
|
setBackgroundImage(UIImage.placeholder(color: Asset.Colors.brandBlue.color), for: .normal)
|
||||||
setBackgroundImage(UIImage.placeholder(color: Asset.Colors.brandBlueDarken20.color), for: .highlighted)
|
setBackgroundImage(UIImage.placeholder(color: Asset.Colors.brandBlueDarken20.color), for: .highlighted)
|
||||||
setBackgroundImage(UIImage.placeholder(color: Asset.Colors.disabled.color), for: .disabled)
|
setBackgroundImage(UIImage.placeholder(color: Asset.Colors.disabled.color), for: .disabled)
|
||||||
applyCornerRadius(radius: 10)
|
}
|
||||||
|
|
||||||
|
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
|
||||||
|
super.traitCollectionDidChange(previousTraitCollection)
|
||||||
|
|
||||||
|
setupBackgroundAppearance()
|
||||||
}
|
}
|
||||||
|
|
||||||
func showLoading() {
|
func showLoading() {
|
||||||
|
|
|
@ -22,7 +22,7 @@ final class AudioContainerView: UIView {
|
||||||
stackView.isLayoutMarginsRelativeArrangement = true
|
stackView.isLayoutMarginsRelativeArrangement = true
|
||||||
stackView.layer.cornerRadius = AudioContainerView.cornerRadius
|
stackView.layer.cornerRadius = AudioContainerView.cornerRadius
|
||||||
stackView.clipsToBounds = true
|
stackView.clipsToBounds = true
|
||||||
stackView.backgroundColor = Asset.Colors.Background.AudioPlayer.highlight.color
|
stackView.backgroundColor = Asset.Colors.brandBlue.color
|
||||||
stackView.translatesAutoresizingMaskIntoConstraints = false
|
stackView.translatesAutoresizingMaskIntoConstraints = false
|
||||||
return stackView
|
return stackView
|
||||||
}()
|
}()
|
||||||
|
@ -31,7 +31,7 @@ final class AudioContainerView: UIView {
|
||||||
let view = UIView()
|
let view = UIView()
|
||||||
view.layer.cornerRadius = 16
|
view.layer.cornerRadius = 16
|
||||||
view.clipsToBounds = true
|
view.clipsToBounds = true
|
||||||
view.backgroundColor = Asset.Colors.Background.AudioPlayer.highlight.color
|
view.backgroundColor = Asset.Colors.brandBlue.color
|
||||||
view.translatesAutoresizingMaskIntoConstraints = false
|
view.translatesAutoresizingMaskIntoConstraints = false
|
||||||
return view
|
return view
|
||||||
}()
|
}()
|
||||||
|
|
|
@ -21,7 +21,7 @@ final class PollOptionView: UIView {
|
||||||
let roundedBackgroundView = UIView()
|
let roundedBackgroundView = UIView()
|
||||||
let voteProgressStripView: StripProgressView = {
|
let voteProgressStripView: StripProgressView = {
|
||||||
let view = StripProgressView()
|
let view = StripProgressView()
|
||||||
view.tintColor = Asset.Colors.Background.Poll.highlight.color
|
view.tintColor = Asset.Colors.brandBlue.color
|
||||||
return view
|
return view
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ final class PollOptionView: UIView {
|
||||||
let imageView = UIImageView()
|
let imageView = UIImageView()
|
||||||
let image = UIImage(systemName: "checkmark", withConfiguration: UIImage.SymbolConfiguration(pointSize: 14, weight: .bold))!
|
let image = UIImage(systemName: "checkmark", withConfiguration: UIImage.SymbolConfiguration(pointSize: 14, weight: .bold))!
|
||||||
imageView.image = image.withRenderingMode(.alwaysTemplate)
|
imageView.image = image.withRenderingMode(.alwaysTemplate)
|
||||||
imageView.tintColor = Asset.Colors.Button.normal.color
|
imageView.tintColor = Asset.Colors.brandBlue.color
|
||||||
return imageView
|
return imageView
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ final class PollOptionView: UIView {
|
||||||
let imageView = UIImageView()
|
let imageView = UIImageView()
|
||||||
let image = Asset.Circles.plusCircle.image
|
let image = Asset.Circles.plusCircle.image
|
||||||
imageView.image = image.withRenderingMode(.alwaysTemplate)
|
imageView.image = image.withRenderingMode(.alwaysTemplate)
|
||||||
imageView.tintColor = Asset.Colors.Button.normal.color
|
imageView.tintColor = Asset.Colors.brandBlue.color
|
||||||
return imageView
|
return imageView
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|
|
@ -126,7 +126,7 @@ final class StatusView: UIView {
|
||||||
let revealContentWarningButton: UIButton = {
|
let revealContentWarningButton: UIButton = {
|
||||||
let button = HighlightDimmableButton()
|
let button = HighlightDimmableButton()
|
||||||
button.setImage(UIImage(systemName: "eye", withConfiguration: UIImage.SymbolConfiguration(pointSize: 17, weight: .medium)), for: .normal)
|
button.setImage(UIImage(systemName: "eye", withConfiguration: UIImage.SymbolConfiguration(pointSize: 17, weight: .medium)), for: .normal)
|
||||||
button.tintColor = Asset.Colors.Button.normal.color
|
button.tintColor = Asset.Colors.brandBlue.color
|
||||||
return button
|
return button
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
@ -175,8 +175,8 @@ final class StatusView: UIView {
|
||||||
let button = HitTestExpandedButton()
|
let button = HitTestExpandedButton()
|
||||||
button.titleLabel?.font = UIFontMetrics(forTextStyle: .body).scaledFont(for: .systemFont(ofSize: 14, weight: .semibold))
|
button.titleLabel?.font = UIFontMetrics(forTextStyle: .body).scaledFont(for: .systemFont(ofSize: 14, weight: .semibold))
|
||||||
button.setTitle(L10n.Common.Controls.Status.Poll.vote, for: .normal)
|
button.setTitle(L10n.Common.Controls.Status.Poll.vote, for: .normal)
|
||||||
button.setTitleColor(Asset.Colors.Button.normal.color, for: .normal)
|
button.setTitleColor(Asset.Colors.brandBlue.color, for: .normal)
|
||||||
button.setTitleColor(Asset.Colors.Button.normal.color.withAlphaComponent(0.8), for: .highlighted)
|
button.setTitleColor(Asset.Colors.brandBlue.color.withAlphaComponent(0.8), for: .highlighted)
|
||||||
button.setTitleColor(Asset.Colors.Button.disabled.color, for: .disabled)
|
button.setTitleColor(Asset.Colors.Button.disabled.color, for: .disabled)
|
||||||
button.isEnabled = false
|
button.isEnabled = false
|
||||||
return button
|
return button
|
||||||
|
|
|
@ -20,8 +20,8 @@ final class ThreadMetaView: UIView {
|
||||||
let button = UIButton()
|
let button = UIButton()
|
||||||
button.titleLabel?.font = UIFontMetrics(forTextStyle: .headline).scaledFont(for: .systemFont(ofSize: 15, weight: .semibold))
|
button.titleLabel?.font = UIFontMetrics(forTextStyle: .headline).scaledFont(for: .systemFont(ofSize: 15, weight: .semibold))
|
||||||
button.setTitle("0 reblog", for: .normal)
|
button.setTitle("0 reblog", for: .normal)
|
||||||
button.setTitleColor(Asset.Colors.Button.normal.color, for: .normal)
|
button.setTitleColor(Asset.Colors.brandBlue.color, for: .normal)
|
||||||
button.setTitleColor(Asset.Colors.Button.normal.color.withAlphaComponent(0.5), for: .highlighted)
|
button.setTitleColor(Asset.Colors.brandBlue.color.withAlphaComponent(0.5), for: .highlighted)
|
||||||
return button
|
return button
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
@ -29,8 +29,8 @@ final class ThreadMetaView: UIView {
|
||||||
let button = UIButton()
|
let button = UIButton()
|
||||||
button.titleLabel?.font = UIFontMetrics(forTextStyle: .headline).scaledFont(for: .systemFont(ofSize: 15, weight: .semibold))
|
button.titleLabel?.font = UIFontMetrics(forTextStyle: .headline).scaledFont(for: .systemFont(ofSize: 15, weight: .semibold))
|
||||||
button.setTitle("0 favorite", for: .normal)
|
button.setTitle("0 favorite", for: .normal)
|
||||||
button.setTitleColor(Asset.Colors.Button.normal.color, for: .normal)
|
button.setTitleColor(Asset.Colors.brandBlue.color, for: .normal)
|
||||||
button.setTitleColor(Asset.Colors.Button.normal.color.withAlphaComponent(0.5), for: .highlighted)
|
button.setTitleColor(Asset.Colors.brandBlue.color.withAlphaComponent(0.5), for: .highlighted)
|
||||||
return button
|
return button
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ final class ThreadReplyLoaderTableViewCell: UITableViewCell {
|
||||||
let button = HighlightDimmableButton()
|
let button = HighlightDimmableButton()
|
||||||
button.titleLabel?.font = TimelineLoaderTableViewCell.labelFont
|
button.titleLabel?.font = TimelineLoaderTableViewCell.labelFont
|
||||||
button.backgroundColor = Asset.Colors.Background.secondaryGroupedSystemBackground.color
|
button.backgroundColor = Asset.Colors.Background.secondaryGroupedSystemBackground.color
|
||||||
button.setTitleColor(Asset.Colors.Button.normal.color, for: .normal)
|
button.setTitleColor(Asset.Colors.brandBlue.color, for: .normal)
|
||||||
button.setTitle(L10n.Common.Controls.Timeline.Loader.showMoreReplies, for: .normal)
|
button.setTitle(L10n.Common.Controls.Timeline.Loader.showMoreReplies, for: .normal)
|
||||||
return button
|
return button
|
||||||
}()
|
}()
|
||||||
|
|
|
@ -23,7 +23,7 @@ class TimelineLoaderTableViewCell: UITableViewCell {
|
||||||
let button = HighlightDimmableButton()
|
let button = HighlightDimmableButton()
|
||||||
button.titleLabel?.font = TimelineLoaderTableViewCell.labelFont
|
button.titleLabel?.font = TimelineLoaderTableViewCell.labelFont
|
||||||
button.backgroundColor = Asset.Colors.Background.systemBackground.color
|
button.backgroundColor = Asset.Colors.Background.systemBackground.color
|
||||||
button.setTitleColor(Asset.Colors.Button.normal.color, for: .normal)
|
button.setTitleColor(Asset.Colors.brandBlue.color, for: .normal)
|
||||||
button.setTitle(L10n.Common.Controls.Timeline.Loader.loadMissingPosts, for: .normal)
|
button.setTitle(L10n.Common.Controls.Timeline.Loader.loadMissingPosts, for: .normal)
|
||||||
button.setTitle("", for: .disabled)
|
button.setTitle("", for: .disabled)
|
||||||
return button
|
return button
|
||||||
|
|
|
@ -22,6 +22,8 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||||||
let window = UIWindow(windowScene: windowScene)
|
let window = UIWindow(windowScene: windowScene)
|
||||||
self.window = window
|
self.window = window
|
||||||
|
|
||||||
|
// set tint color
|
||||||
|
window.tintColor = Asset.Colors.brandBlue.color
|
||||||
|
|
||||||
let appContext = AppContext.shared
|
let appContext = AppContext.shared
|
||||||
let sceneCoordinator = SceneCoordinator(scene: scene, sceneDelegate: self, appContext: appContext)
|
let sceneCoordinator = SceneCoordinator(scene: scene, sceneDelegate: self, appContext: appContext)
|
||||||
|
|
Loading…
Reference in New Issue