From 96d8a79d42b5edbf70862010221af0ad57cd98c9 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Fri, 4 Nov 2022 21:47:39 -0400 Subject: [PATCH] Dynamic type support in Explore screen --- .../FeaturedProfileCollectionViewCell.swift | 6 +++- .../Instance Cell/InstanceTableViewCell.swift | 6 ++++ .../Instance Cell/InstanceTableViewCell.xib | 32 ++++++++++++------- 3 files changed, 32 insertions(+), 12 deletions(-) diff --git a/Tusker/Screens/Explore/FeaturedProfileCollectionViewCell.swift b/Tusker/Screens/Explore/FeaturedProfileCollectionViewCell.swift index 9eaf8df2f1..589b097b68 100644 --- a/Tusker/Screens/Explore/FeaturedProfileCollectionViewCell.swift +++ b/Tusker/Screens/Explore/FeaturedProfileCollectionViewCell.swift @@ -29,7 +29,11 @@ class FeaturedProfileCollectionViewCell: UICollectionViewCell { avatarContainerView.layer.cornerRadius = Preferences.shared.avatarStyle.cornerRadius(for: avatarContainerView) avatarImageView.layer.cornerRadius = Preferences.shared.avatarStyle.cornerRadius(for: avatarImageView) - noteTextView.defaultFont = .systemFont(ofSize: 16) + displayNameLabel.font = UIFontMetrics(forTextStyle: .title1).scaledFont(for: .systemFont(ofSize: 20, weight: .semibold)) + displayNameLabel.adjustsFontForContentSizeCategory = true + + noteTextView.defaultFont = .preferredFont(forTextStyle: .body) + noteTextView.adjustsFontForContentSizeCategory = true noteTextView.textContainer.lineBreakMode = .byTruncatingTail noteTextView.textContainerInset = UIEdgeInsets(top: 16, left: 4, bottom: 16, right: 4) diff --git a/Tusker/Views/Instance Cell/InstanceTableViewCell.swift b/Tusker/Views/Instance Cell/InstanceTableViewCell.swift index c672dc75b5..6fda7a3145 100644 --- a/Tusker/Views/Instance Cell/InstanceTableViewCell.swift +++ b/Tusker/Views/Instance Cell/InstanceTableViewCell.swift @@ -28,8 +28,14 @@ class InstanceTableViewCell: UITableViewCell { thumbnailImageView.layer.masksToBounds = true thumbnailImageView.layer.cornerRadius = 5 + domainLabel.font = UIFontMetrics(forTextStyle: .title1).scaledFont(for: .systemFont(ofSize: 22, weight: .bold)) + domainLabel.adjustsFontForContentSizeCategory = true + adultLabel.layer.masksToBounds = true adultLabel.layer.cornerRadius = 0.5 * adultLabel.bounds.height + + descriptionTextView.defaultFont = .preferredFont(forTextStyle: .body) + descriptionTextView.adjustsFontForContentSizeCategory = true } func updateUI(instance: InstanceSelector.Instance) { diff --git a/Tusker/Views/Instance Cell/InstanceTableViewCell.xib b/Tusker/Views/Instance Cell/InstanceTableViewCell.xib index e8a0881c33..b2dbadacaa 100644 --- a/Tusker/Views/Instance Cell/InstanceTableViewCell.xib +++ b/Tusker/Views/Instance Cell/InstanceTableViewCell.xib @@ -1,9 +1,11 @@ - + - + + + @@ -27,34 +29,34 @@ - + - - - - - + + + + @@ -79,4 +81,12 @@ + + + + + + + +