Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stats Subscribers: Dynamic type support improvements #23141

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ extension WPStyleGuide {
static func configureLabelAsSubtitle(_ label: UILabel) {
label.textColor = .DS.Foreground.secondary
label.font = .DS.font(.footnote)
label.adjustsFontSizeToFitWidth = true
label.maximumContentSizeCategory = .accessibilityLarge
}

static func configureLabelAsLink(_ label: UILabel) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ class StatsBaseCell: UITableViewCell {
let label = UILabel()
label.translatesAutoresizingMaskIntoConstraints = false
label.font = UIFont.preferredFont(forTextStyle: .headline)
label.maximumContentSizeCategory = .extraExtraExtraLarge
label.adjustsFontForContentSizeCategory = true
label.adjustsFontSizeToFitWidth = true
label.numberOfLines = 0
return label
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ class StatsTotalInsightsCell: StatsBaseCell {
countLabel.adjustsFontSizeToFitWidth = true
countLabel.setContentHuggingPriority(.defaultLow, for: .horizontal)
countLabel.setContentHuggingPriority(.required, for: .vertical)
countLabel.maximumContentSizeCategory = .accessibilityLarge

comparisonLabel.font = .preferredFont(forTextStyle: .subheadline)
comparisonLabel.textColor = .textSubtle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,11 @@ private extension StatsTotalRow {
Style.configureViewAsSeparator(topExpandedSeparatorLine)
Style.configureViewAsDataBar(dataBar)

[itemLabel, itemDetailLabel, dataLabel, secondDataLabel].forEach {
$0?.adjustsFontForContentSizeCategory = true
$0?.maximumContentSizeCategory = .extraExtraLarge
}

[itemLabel, itemDetailLabel].forEach {
$0?.numberOfLines = rowData.multiline ? 0 : 1
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ private extension ViewMoreRow {
backgroundColor = .listForeground
viewMoreLabel.text = NSLocalizedString("View more", comment: "Label for viewing more stats.")
viewMoreLabel.textColor = WPStyleGuide.Stats.actionTextColor
viewMoreLabel.maximumContentSizeCategory = .extraExtraExtraLarge
if statSection == .insightsFollowersWordPress ||
statSection == .insightsFollowersEmail ||
statSection == .subscribersList ||
Expand Down
Loading