Commit f37c9198 authored by Gauthier Ambard's avatar Gauthier Ambard Committed by Commit Bot

[iOS] Remove font cap on empty ReadingList view

This CL removes the cap on the font size used to display the
instructions on the empty TableView background in ReadingList.

Bug: 911174
Change-Id: Iaadd7cd0e9d070a0052847daa513e3f1ae1b50b7
Reviewed-on: https://chromium-review.googlesource.com/c/1358465
Commit-Queue: Kurt Horimoto <kkhorimoto@chromium.org>
Reviewed-by: default avatarKurt Horimoto <kkhorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#613270}
parent 377e23f4
...@@ -27,30 +27,9 @@ NSString* const kReadLaterTextMarker = @"READ_LATER_TEXT"; ...@@ -27,30 +27,9 @@ NSString* const kReadLaterTextMarker = @"READ_LATER_TEXT";
// Background view constants. // Background view constants.
const CGFloat kLineSpacing = 4; const CGFloat kLineSpacing = 4;
UIFont* FontWithMaximumForCategory(UIContentSizeCategory category,
UIFontTextStyle font_style) {
if (UIContentSizeCategoryIsAccessibilityCategory(category)) {
return [UIFont
preferredFontForTextStyle:font_style
compatibleWithTraitCollection:
[UITraitCollection traitCollectionWithPreferredContentSizeCategory:
UIContentSizeCategoryAccessibilityLarge]];
}
return [UIFont preferredFontForTextStyle:font_style];
}
// Returns the font to use for the message text. // Returns the font to use for the message text.
UIFont* GetMessageFont() { UIFont* GetMessageFont() {
return FontWithMaximumForCategory( return [UIFont preferredFontForTextStyle:UIFontTextStyleBody];
[UIApplication sharedApplication].preferredContentSizeCategory,
UIFontTextStyleBody);
}
// Returns the font to use for the message text.
UIFont* GetInstructionFont() {
return FontWithMaximumForCategory(
[UIApplication sharedApplication].preferredContentSizeCategory,
UIFontTextStyleHeadline);
} }
// Returns the attributes to use for the message text. // Returns the attributes to use for the message text.
...@@ -75,7 +54,8 @@ NSMutableDictionary* GetMessageAttributes() { ...@@ -75,7 +54,8 @@ NSMutableDictionary* GetMessageAttributes() {
// Later" option. // Later" option.
NSMutableDictionary* GetInstructionAttributes() { NSMutableDictionary* GetInstructionAttributes() {
NSMutableDictionary* attributes = GetMessageAttributes(); NSMutableDictionary* attributes = GetMessageAttributes();
attributes[NSFontAttributeName] = GetInstructionFont(); attributes[NSFontAttributeName] =
[UIFont preferredFontForTextStyle:UIFontTextStyleHeadline];
return attributes; return attributes;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment