Skip to content
Permalink
Browse files

[ios] Disables Dynamic type for ConfirmInfobarView on iOS13.

Used the size and weight from:
https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/typography/

(cherry picked from commit 80d1062)

Bug: 989761
Change-Id: Ife83bf55ab112ec61fccab329be5c908d83df3c7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1884363
Reviewed-by: Peter Lee <pkl@chromium.org>
Commit-Queue: Sergio Collazos <sczs@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#710040}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1886291
Reviewed-by: Kariah Davis <kariahda@chromium.org>
Cr-Commit-Position: refs/branch-heads/3904@{#822}
Cr-Branched-From: 675968a-refs/heads/master@{#693954}
  • Loading branch information
sczs Kariah Davis
sczs authored and Kariah Davis committed Oct 29, 2019
1 parent 1f887ce commit 1e430582b8bf2a69dd5c537eabfc0bd1efe204c2
Showing with 21 additions and 5 deletions.
  1. +21 −5 ios/chrome/browser/ui/infobars/confirm_infobar_view.mm
@@ -87,19 +87,35 @@

// Returns the font for the Infobar's main body text.
UIFont* InfoBarLabelFont() {
return [UIFont preferredFontForTextStyle:UIFontTextStyleBody];
// Due to https://crbug.com/989761, disable dynamic type. Once migration to
// Messages is complete, this class will be deleted.
if (@available(iOS 13, *)) {
return [UIFont systemFontOfSize:17];
} else {
return [UIFont preferredFontForTextStyle:UIFontTextStyleBody];
}
}

// Returns the font for the Infobar's toggle switch's (if one exists) body text.
// This text label is usually of a slightly smaller font size relative to
// InfoBarLabelFont().
UIFont* InfoBarSwitchLabelFont() {
return [UIFont preferredFontForTextStyle:UIFontTextStyleBody];
// Due to https://crbug.com/989761, disable dynamic type. Once migration to
// Messages is complete, this class will be deleted.
if (@available(iOS 13, *)) {
return [UIFont systemFontOfSize:17];
} else {
return [UIFont preferredFontForTextStyle:UIFontTextStyleBody];
}
}

// Returns the font for the label on Infobar's action buttons.
UIFont* InfoBarButtonLabelFont() {
return [UIFont preferredFontForTextStyle:UIFontTextStyleHeadline];
// Due to https://crbug.com/989761, disable dynamic type. Once migration to
// Messages is complete, this class will be deleted.
if (@available(iOS 13, *)) {
return [UIFont systemFontOfSize:17 weight:UIFontWeightSemibold];
} else {
return [UIFont preferredFontForTextStyle:UIFontTextStyleHeadline];
}
}

UIImage* InfoBarCloseImage() {

0 comments on commit 1e43058

Please sign in to comment.
You can’t perform that action at this time.