From 59755b6d70b4f5541f6a693e2bfc57a0603fb5d7 Mon Sep 17 00:00:00 2001 From: Nathan Mattes Date: Sat, 4 Nov 2023 23:19:40 +0100 Subject: [PATCH 1/5] Adjust fonts, icon and colors for updated verified-design (IOS-130) --- .../Profile/ProfileFieldSection.swift | 36 +++++++++---------- .../Cell/ProfileFieldCollectionViewCell.swift | 22 ++---------- ...eFieldCollectionViewHeaderFooterView.swift | 13 +------ .../MastodonUI/Extension/MetaLabel.swift | 2 +- 4 files changed, 21 insertions(+), 52 deletions(-) diff --git a/Mastodon/Diffable/Profile/ProfileFieldSection.swift b/Mastodon/Diffable/Profile/ProfileFieldSection.swift index c7d530f2b..0303cf89d 100644 --- a/Mastodon/Diffable/Profile/ProfileFieldSection.swift +++ b/Mastodon/Diffable/Profile/ProfileFieldSection.swift @@ -35,28 +35,26 @@ extension ProfileFieldSection { let fieldCellRegistration = UICollectionView.CellRegistration { cell, indexPath, item in let key, value: String let emojiMeta: MastodonContent.Emojis - let verified: Bool switch item { - case .field(field: let field): - key = field.name.value - value = field.value.value - emojiMeta = field.emojiMeta - verified = field.verifiedAt.value != nil - case .createdAt(date: let date): - key = L10n.Scene.Profile.Fields.joined - let formatter = DateFormatter() - formatter.dateStyle = .medium - formatter.timeStyle = .none - formatter.timeZone = TimeZone(identifier: "UTC") - value = formatter.string(from: date) - emojiMeta = [:] - verified = false - default: return + case .field(field: let field): + key = field.name.value + value = field.value.value + emojiMeta = field.emojiMeta + + case .createdAt(date: let date): + key = L10n.Scene.Profile.Fields.joined + let formatter = DateFormatter() + formatter.dateStyle = .medium + formatter.timeStyle = .none + formatter.timeZone = TimeZone(identifier: "UTC") + value = formatter.string(from: date) + emojiMeta = [:] + case .addEntry, .editField(_): return } // set key - let keyColor = verified ? Asset.Scene.Profile.About.bioAboutFieldVerifiedText.color : Asset.Colors.Label.secondary.color + let keyColor = Asset.Colors.Label.secondary.color do { let mastodonContent = MastodonContent(content: key, emojis: emojiMeta) let metaContent = try MastodonMetaContent.convert(document: mastodonContent) @@ -69,7 +67,7 @@ extension ProfileFieldSection { } // set value - let linkColor = verified ? Asset.Scene.Profile.About.bioAboutFieldVerifiedText.color : Asset.Colors.Brand.blurple.color + let linkColor = Asset.Colors.Brand.blurple.color do { let mastodonContent = MastodonContent(content: value, emojis: emojiMeta) let metaContent = try MastodonMetaContent.convert(document: mastodonContent) @@ -83,7 +81,7 @@ extension ProfileFieldSection { // set background var backgroundConfiguration = UIBackgroundConfiguration.listPlainCell() - backgroundConfiguration.backgroundColor = verified ? Asset.Scene.Profile.About.bioAboutFieldVerifiedBackground.color : UIColor.secondarySystemBackground + backgroundConfiguration.backgroundColor = UIColor.secondarySystemBackground cell.backgroundConfiguration = backgroundConfiguration // set checkmark and edit menu label diff --git a/Mastodon/Scene/Profile/About/Cell/ProfileFieldCollectionViewCell.swift b/Mastodon/Scene/Profile/About/Cell/ProfileFieldCollectionViewCell.swift index 099799c6e..de9b88335 100644 --- a/Mastodon/Scene/Profile/About/Cell/ProfileFieldCollectionViewCell.swift +++ b/Mastodon/Scene/Profile/About/Cell/ProfileFieldCollectionViewCell.swift @@ -25,7 +25,7 @@ final class ProfileFieldCollectionViewCell: UICollectionViewCell { let keyMetaLabel = MetaLabel(style: .profileFieldName) let valueMetaLabel = MetaLabel(style: .profileFieldValue) - let checkmark = UIImageView(image: Asset.Editing.checkmark.image.withRenderingMode(.alwaysTemplate)) + let checkmark = UIImageView(image: UIImage(systemName: "checkmark.seal")) var checkmarkPopoverString: String? = nil; let tapGesture = UITapGestureRecognizer(); var editMenuInteraction: UIEditMenuInteraction! @@ -55,7 +55,7 @@ extension ProfileFieldCollectionViewCell { editMenuInteraction = UIEditMenuInteraction(delegate: self) // Setup colors - checkmark.tintColor = Asset.Scene.Profile.About.bioAboutFieldVerifiedText.color; + checkmark.tintColor = Asset.Colors.Brand.blurple.color // Setup gestures tapGesture.addTarget(self, action: #selector(ProfileFieldCollectionViewCell.didTapCheckmark(_:))) @@ -145,24 +145,6 @@ extension ProfileFieldCollectionViewCell { } } -// UIMenuController boilerplate -@available(iOS, deprecated: 16, message: "Can be removed when target version is >=16 -- boilerplate to maintain compatibility with UIMenuController") -extension ProfileFieldCollectionViewCell { - override var canBecomeFirstResponder: Bool { true } - - override func canPerformAction(_ action: Selector, withSender sender: Any?) -> Bool { - if action == #selector(dismissVerifiedMenu) { - return true - } - - return super.canPerformAction(action, withSender: sender) - } - - @objc public func dismissVerifiedMenu() { - UIMenuController.shared.hideMenu() - } -} - // MARK: - MetaLabelDelegate extension ProfileFieldCollectionViewCell: MetaLabelDelegate { func metaLabel(_ metaLabel: MetaLabel, didSelectMeta meta: Meta) { diff --git a/Mastodon/Scene/Profile/Header/View/ProfileFieldCollectionViewHeaderFooterView.swift b/Mastodon/Scene/Profile/Header/View/ProfileFieldCollectionViewHeaderFooterView.swift index 8a0d3c6d6..8795dfd23 100644 --- a/Mastodon/Scene/Profile/Header/View/ProfileFieldCollectionViewHeaderFooterView.swift +++ b/Mastodon/Scene/Profile/Header/View/ProfileFieldCollectionViewHeaderFooterView.swift @@ -14,18 +14,7 @@ final class ProfileFieldCollectionViewHeaderFooterView: UICollectionReusableView override init(frame: CGRect) { super.init(frame: frame) - _init() - } - - required init?(coder: NSCoder) { - super.init(coder: coder) - _init() } -} - -extension ProfileFieldCollectionViewHeaderFooterView { - private func _init() { - - } + required init?(coder: NSCoder) { fatalError("Not implemented") } } diff --git a/MastodonSDK/Sources/MastodonUI/Extension/MetaLabel.swift b/MastodonSDK/Sources/MastodonUI/Extension/MetaLabel.swift index cee24e98b..d69342d81 100644 --- a/MastodonSDK/Sources/MastodonUI/Extension/MetaLabel.swift +++ b/MastodonSDK/Sources/MastodonUI/Extension/MetaLabel.swift @@ -78,7 +78,7 @@ extension MetaLabel { textColor = Asset.Colors.Label.secondary.color case .profileFieldName: - font = UIFontMetrics(forTextStyle: .headline).scaledFont(for: .systemFont(ofSize: 13, weight: .semibold)) + font = UIFontMetrics(forTextStyle: .headline).scaledFont(for: .systemFont(ofSize: 13, weight: .regular)) textColor = Asset.Colors.Label.secondary.color case .profileFieldValue: From 6e22868f5538fa6f8421afaaf93ee7a29d888451 Mon Sep 17 00:00:00 2001 From: Nathan Mattes Date: Sat, 4 Nov 2023 23:32:43 +0100 Subject: [PATCH 2/5] Remove obsolete asset (IOS-130) --- .../Editing/checkmark.imageset/Contents.json | 15 ---- .../Editing/checkmark.imageset/checkmark.pdf | 76 ------------------- .../MastodonAsset/Generated/Assets.swift | 1 - 3 files changed, 92 deletions(-) delete mode 100644 MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Editing/checkmark.imageset/Contents.json delete mode 100644 MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Editing/checkmark.imageset/checkmark.pdf diff --git a/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Editing/checkmark.imageset/Contents.json b/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Editing/checkmark.imageset/Contents.json deleted file mode 100644 index 8879a2751..000000000 --- a/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Editing/checkmark.imageset/Contents.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "images" : [ - { - "filename" : "checkmark.pdf", - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - }, - "properties" : { - "preserves-vector-representation" : true - } -} diff --git a/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Editing/checkmark.imageset/checkmark.pdf b/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Editing/checkmark.imageset/checkmark.pdf deleted file mode 100644 index c481ec4c5..000000000 --- a/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Editing/checkmark.imageset/checkmark.pdf +++ /dev/null @@ -1,76 +0,0 @@ -%PDF-1.7 - -1 0 obj - << >> -endobj - -2 0 obj - << /Length 3 0 R >> -stream -/DeviceRGB CS -/DeviceRGB cs -q -1.000000 0.000000 -0.000000 1.000000 3.250000 5.105469 cm -0.129412 0.129412 0.129412 scn -1.280330 5.924861 m -0.987437 6.217754 0.512563 6.217754 0.219670 5.924861 c --0.073223 5.631968 -0.073223 5.157095 0.219670 4.864202 c -4.719670 0.364201 l -5.012563 0.071307 5.487436 0.071307 5.780330 0.364201 c -16.780331 11.364201 l -17.073223 11.657094 17.073223 12.131968 16.780331 12.424861 c -16.487438 12.717754 16.012562 12.717754 15.719669 12.424861 c -5.250000 1.955191 l -1.280330 5.924861 l -h -f -n -Q - -endstream -endobj - -3 0 obj - 523 -endobj - -4 0 obj - << /Annots [] - /Type /Page - /MediaBox [ 0.000000 0.000000 24.000000 24.000000 ] - /Resources 1 0 R - /Contents 2 0 R - /Parent 5 0 R - >> -endobj - -5 0 obj - << /Kids [ 4 0 R ] - /Count 1 - /Type /Pages - >> -endobj - -6 0 obj - << /Pages 5 0 R - /Type /Catalog - >> -endobj - -xref -0 7 -0000000000 65535 f -0000000010 00000 n -0000000034 00000 n -0000000613 00000 n -0000000635 00000 n -0000000808 00000 n -0000000882 00000 n -trailer -<< /ID [ (some) (id) ] - /Root 6 0 R - /Size 7 ->> -startxref -941 -%%EOF \ No newline at end of file diff --git a/MastodonSDK/Sources/MastodonAsset/Generated/Assets.swift b/MastodonSDK/Sources/MastodonAsset/Generated/Assets.swift index 9414c01e9..a161711c1 100644 --- a/MastodonSDK/Sources/MastodonAsset/Generated/Assets.swift +++ b/MastodonSDK/Sources/MastodonAsset/Generated/Assets.swift @@ -119,7 +119,6 @@ public enum Asset { } public enum Editing { public static let checkmark20 = ImageAsset(name: "Editing/checkmark.20") - public static let checkmark = ImageAsset(name: "Editing/checkmark") public static let xmark = ImageAsset(name: "Editing/xmark") } public enum Human { From c0bdcc43a15977c5de3da5311727100d5ef2401c Mon Sep 17 00:00:00 2001 From: Nathan Mattes Date: Sat, 4 Nov 2023 23:33:02 +0100 Subject: [PATCH 3/5] Refactor layout to center checkmark (IOS-130) --- .../Cell/ProfileFieldCollectionViewCell.swift | 41 ++++++++++--------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/Mastodon/Scene/Profile/About/Cell/ProfileFieldCollectionViewCell.swift b/Mastodon/Scene/Profile/About/Cell/ProfileFieldCollectionViewCell.swift index de9b88335..323971be3 100644 --- a/Mastodon/Scene/Profile/About/Cell/ProfileFieldCollectionViewCell.swift +++ b/Mastodon/Scene/Profile/About/Cell/ProfileFieldCollectionViewCell.swift @@ -56,7 +56,7 @@ extension ProfileFieldCollectionViewCell { // Setup colors checkmark.tintColor = Asset.Colors.Brand.blurple.color - + // Setup gestures tapGesture.addTarget(self, action: #selector(ProfileFieldCollectionViewCell.didTapCheckmark(_:))) checkmark.addGestureRecognizer(tapGesture) @@ -76,30 +76,33 @@ extension ProfileFieldCollectionViewCell { containerStackView.preservesSuperviewLayoutMargins = true containerStackView.isLayoutMarginsRelativeArrangement = true containerStackView.translatesAutoresizingMaskIntoConstraints = false - addSubview(containerStackView) + contentView.addSubview(containerStackView) NSLayoutConstraint.activate([ - containerStackView.topAnchor.constraint(equalTo: topAnchor, constant: 11), - containerStackView.leadingAnchor.constraint(equalTo: leadingAnchor), - containerStackView.trailingAnchor.constraint(equalTo: trailingAnchor), - bottomAnchor.constraint(equalTo: containerStackView.bottomAnchor, constant: 11), + containerStackView.topAnchor.constraint(equalTo: contentView.topAnchor, constant: 11), + containerStackView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor), + contentView.trailingAnchor.constraint(equalTo: containerStackView.trailingAnchor), + contentView.bottomAnchor.constraint(equalTo: containerStackView.bottomAnchor, constant: 11), ]) - // metaContainer: V - [ keyMetaLabel | valueContainer ] + // metaContainer: h - [ keyValueContainer | checkmark ] let metaContainer = UIStackView() - metaContainer.axis = .vertical + metaContainer.axis = .horizontal metaContainer.spacing = 2 + metaContainer.alignment = .center + + // valueContainer: v - [ keyMetaLabel | valueMetaLabel ] + let keyValueContainer = UIStackView() + keyValueContainer.axis = .vertical + keyValueContainer.alignment = .leading + keyValueContainer.spacing = 2 + containerStackView.addArrangedSubview(metaContainer) - - // valueContainer: H - [ valueMetaLabel | checkmark ] - let valueContainer = UIStackView() - valueContainer.axis = .horizontal - valueContainer.spacing = 2 - - metaContainer.addArrangedSubview(keyMetaLabel) - valueContainer.addArrangedSubview(valueMetaLabel) - valueContainer.addArrangedSubview(checkmark) - metaContainer.addArrangedSubview(valueContainer) - + keyValueContainer.addArrangedSubview(keyMetaLabel) + keyValueContainer.addArrangedSubview(valueMetaLabel) + + metaContainer.addArrangedSubview(keyValueContainer) + metaContainer.addArrangedSubview(checkmark) + keyMetaLabel.linkDelegate = self valueMetaLabel.linkDelegate = self From c764db270e9da0d86765b9363c57f3cb44f00b4c Mon Sep 17 00:00:00 2001 From: Nathan Mattes Date: Sat, 4 Nov 2023 23:52:43 +0100 Subject: [PATCH 4/5] Use different assets for dark/light-mode (IOS-130) --- .../Cell/ProfileFieldCollectionViewCell.swift | 38 ++++++++++--------- .../Contents.json | 38 ------------------- .../Contents.json | 38 ------------------- .../verified_checkmark.imageset/Contents.json | 22 +++++++++++ .../checkmark.seal.fill.svg | 11 ++++++ .../checkmark.seal.svg | 11 ++++++ .../MastodonAsset/Generated/Assets.swift | 3 +- 7 files changed, 65 insertions(+), 96 deletions(-) delete mode 100644 MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Profile/About/bio.about.field.verified.background.colorset/Contents.json delete mode 100644 MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Profile/About/bio.about.field.verified.text.colorset/Contents.json create mode 100644 MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Profile/About/verified_checkmark.imageset/Contents.json create mode 100644 MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Profile/About/verified_checkmark.imageset/checkmark.seal.fill.svg create mode 100644 MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Profile/About/verified_checkmark.imageset/checkmark.seal.svg diff --git a/Mastodon/Scene/Profile/About/Cell/ProfileFieldCollectionViewCell.swift b/Mastodon/Scene/Profile/About/Cell/ProfileFieldCollectionViewCell.swift index 323971be3..a0cbf7a16 100644 --- a/Mastodon/Scene/Profile/About/Cell/ProfileFieldCollectionViewCell.swift +++ b/Mastodon/Scene/Profile/About/Cell/ProfileFieldCollectionViewCell.swift @@ -25,7 +25,7 @@ final class ProfileFieldCollectionViewCell: UICollectionViewCell { let keyMetaLabel = MetaLabel(style: .profileFieldName) let valueMetaLabel = MetaLabel(style: .profileFieldValue) - let checkmark = UIImageView(image: UIImage(systemName: "checkmark.seal")) + let checkmark: UIImageView var checkmarkPopoverString: String? = nil; let tapGesture = UITapGestureRecognizer(); var editMenuInteraction: UIEditMenuInteraction! @@ -37,25 +37,15 @@ final class ProfileFieldCollectionViewCell: UICollectionViewCell { } override init(frame: CGRect) { - super.init(frame: frame) - _init() - } - - required init?(coder: NSCoder) { - super.init(coder: coder) - _init() - } - -} - -extension ProfileFieldCollectionViewCell { - - private func _init() { - - editMenuInteraction = UIEditMenuInteraction(delegate: self) // Setup colors + checkmark = UIImageView(image: Asset.Scene.Profile.About.verifiedCheckmark.image.withRenderingMode(.alwaysTemplate)) checkmark.tintColor = Asset.Colors.Brand.blurple.color + checkmark.translatesAutoresizingMaskIntoConstraints = false + + super.init(frame: frame) + + editMenuInteraction = UIEditMenuInteraction(delegate: self) // Setup gestures tapGesture.addTarget(self, action: #selector(ProfileFieldCollectionViewCell.didTapCheckmark(_:))) @@ -82,6 +72,8 @@ extension ProfileFieldCollectionViewCell { containerStackView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor), contentView.trailingAnchor.constraint(equalTo: containerStackView.trailingAnchor), contentView.bottomAnchor.constraint(equalTo: containerStackView.bottomAnchor, constant: 11), + checkmark.heightAnchor.constraint(equalToConstant: 22), + checkmark.widthAnchor.constraint(equalTo: checkmark.heightAnchor), ]) // metaContainer: h - [ keyValueContainer | checkmark ] @@ -108,7 +100,11 @@ extension ProfileFieldCollectionViewCell { isAccessibilityElement = true } - + + required init?(coder: NSCoder) { fatalError("Just ... don't.") } + + //MARK: - Actions + @objc public func didTapCheckmark(_ recognizer: UITapGestureRecognizer) { editMenuInteraction?.presentEditMenu(with: UIEditMenuConfiguration(identifier: nil, sourcePoint: recognizer.location(in: checkmark))) } @@ -123,6 +119,7 @@ extension ProfileFieldCollectionViewCell { return result } + //MARK: - Accessibility override func accessibilityActivate() -> Bool { if let (_, meta) = valueMetas.first { delegate?.profileFieldCollectionViewCell(self, metaLabel: valueMetaLabel, didSelectMeta: meta) @@ -146,6 +143,11 @@ extension ProfileFieldCollectionViewCell { } set {} } + + override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { + super.traitCollectionDidChange(previousTraitCollection) + checkmark.image = Asset.Scene.Profile.About.verifiedCheckmark.image.withRenderingMode(.alwaysTemplate) + } } // MARK: - MetaLabelDelegate diff --git a/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Profile/About/bio.about.field.verified.background.colorset/Contents.json b/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Profile/About/bio.about.field.verified.background.colorset/Contents.json deleted file mode 100644 index 86944ced3..000000000 --- a/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Profile/About/bio.about.field.verified.background.colorset/Contents.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "colors" : [ - { - "color" : { - "color-space" : "srgb", - "components" : { - "alpha" : "1.000", - "blue" : "0.852", - "green" : "0.894", - "red" : "0.835" - } - }, - "idiom" : "universal" - }, - { - "appearances" : [ - { - "appearance" : "luminosity", - "value" : "dark" - } - ], - "color" : { - "color-space" : "srgb", - "components" : { - "alpha" : "1.000", - "blue" : "0.354", - "green" : "0.353", - "red" : "0.268" - } - }, - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Profile/About/bio.about.field.verified.text.colorset/Contents.json b/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Profile/About/bio.about.field.verified.text.colorset/Contents.json deleted file mode 100644 index f5112f04f..000000000 --- a/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Profile/About/bio.about.field.verified.text.colorset/Contents.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "colors" : [ - { - "color" : { - "color-space" : "srgb", - "components" : { - "alpha" : "1.000", - "blue" : "0.371", - "green" : "0.565", - "red" : "0.290" - } - }, - "idiom" : "universal" - }, - { - "appearances" : [ - { - "appearance" : "luminosity", - "value" : "dark" - } - ], - "color" : { - "color-space" : "srgb", - "components" : { - "alpha" : "1.000", - "blue" : "0.603", - "green" : "0.742", - "red" : "0.476" - } - }, - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Profile/About/verified_checkmark.imageset/Contents.json b/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Profile/About/verified_checkmark.imageset/Contents.json new file mode 100644 index 000000000..19f671617 --- /dev/null +++ b/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Profile/About/verified_checkmark.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "filename" : "checkmark.seal.svg", + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "filename" : "checkmark.seal.fill.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Profile/About/verified_checkmark.imageset/checkmark.seal.fill.svg b/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Profile/About/verified_checkmark.imageset/checkmark.seal.fill.svg new file mode 100644 index 000000000..29bcfdb2f --- /dev/null +++ b/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Profile/About/verified_checkmark.imageset/checkmark.seal.fill.svg @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Profile/About/verified_checkmark.imageset/checkmark.seal.svg b/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Profile/About/verified_checkmark.imageset/checkmark.seal.svg new file mode 100644 index 000000000..5ccf1ae3c --- /dev/null +++ b/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Scene/Profile/About/verified_checkmark.imageset/checkmark.seal.svg @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/MastodonSDK/Sources/MastodonAsset/Generated/Assets.swift b/MastodonSDK/Sources/MastodonAsset/Generated/Assets.swift index a161711c1..f6f70b12c 100644 --- a/MastodonSDK/Sources/MastodonAsset/Generated/Assets.swift +++ b/MastodonSDK/Sources/MastodonAsset/Generated/Assets.swift @@ -180,8 +180,7 @@ public enum Asset { } public enum Profile { public enum About { - public static let bioAboutFieldVerifiedBackground = ColorAsset(name: "Scene/Profile/About/bio.about.field.verified.background") - public static let bioAboutFieldVerifiedText = ColorAsset(name: "Scene/Profile/About/bio.about.field.verified.text") + public static let verifiedCheckmark = ImageAsset(name: "Scene/Profile/About/verified_checkmark") } public enum Banner { public static let bioEditBackgroundGray = ColorAsset(name: "Scene/Profile/Banner/bio.edit.background.gray") From e445564e0a98c8ee97348faaad0f4caf35c30d95 Mon Sep 17 00:00:00 2001 From: Nathan Mattes Date: Sun, 5 Nov 2023 00:08:11 +0100 Subject: [PATCH 5/5] Doublecheck fonts and constraints (IOS-130) --- .../Profile/About/Cell/ProfileFieldCollectionViewCell.swift | 4 ++-- MastodonSDK/Sources/MastodonUI/Extension/MetaLabel.swift | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Mastodon/Scene/Profile/About/Cell/ProfileFieldCollectionViewCell.swift b/Mastodon/Scene/Profile/About/Cell/ProfileFieldCollectionViewCell.swift index a0cbf7a16..94a7c1fa7 100644 --- a/Mastodon/Scene/Profile/About/Cell/ProfileFieldCollectionViewCell.swift +++ b/Mastodon/Scene/Profile/About/Cell/ProfileFieldCollectionViewCell.swift @@ -68,10 +68,10 @@ final class ProfileFieldCollectionViewCell: UICollectionViewCell { containerStackView.translatesAutoresizingMaskIntoConstraints = false contentView.addSubview(containerStackView) NSLayoutConstraint.activate([ - containerStackView.topAnchor.constraint(equalTo: contentView.topAnchor, constant: 11), + containerStackView.topAnchor.constraint(equalTo: contentView.topAnchor, constant: 8), containerStackView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor), contentView.trailingAnchor.constraint(equalTo: containerStackView.trailingAnchor), - contentView.bottomAnchor.constraint(equalTo: containerStackView.bottomAnchor, constant: 11), + contentView.bottomAnchor.constraint(equalTo: containerStackView.bottomAnchor, constant: 8), checkmark.heightAnchor.constraint(equalToConstant: 22), checkmark.widthAnchor.constraint(equalTo: checkmark.heightAnchor), ]) diff --git a/MastodonSDK/Sources/MastodonUI/Extension/MetaLabel.swift b/MastodonSDK/Sources/MastodonUI/Extension/MetaLabel.swift index d69342d81..9fe3024c9 100644 --- a/MastodonSDK/Sources/MastodonUI/Extension/MetaLabel.swift +++ b/MastodonSDK/Sources/MastodonUI/Extension/MetaLabel.swift @@ -78,11 +78,11 @@ extension MetaLabel { textColor = Asset.Colors.Label.secondary.color case .profileFieldName: - font = UIFontMetrics(forTextStyle: .headline).scaledFont(for: .systemFont(ofSize: 13, weight: .regular)) + font = UIFontMetrics(forTextStyle: .caption1).scaledFont(for: .systemFont(ofSize: 12, weight: .regular)) textColor = Asset.Colors.Label.secondary.color case .profileFieldValue: - font = UIFontMetrics(forTextStyle: .headline).scaledFont(for: .systemFont(ofSize: 17, weight: .regular)) + font = UIFontMetrics(forTextStyle: .body).scaledFont(for: .systemFont(ofSize: 17, weight: .regular)) textColor = Asset.Colors.Label.primary.color case .profileCardName: