Commit 92fb1f8c authored by Rohit Rao's avatar Rohit Rao Committed by Commit Bot

[ios] Fixes layout of the sync encryption passphrase screen.

We were changing to a bold weight font in
collectionView:cellForRowAtIndexPath:.  This was causing the text to
reflow onto three lines instead of two, but the collection view didn't
know that it needed to recompute cell heights, causing a rendering
issue.  This CL works around the issue by leaving the font at a normal
weight, so that no text reflow occurs.

BUG=864495

Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I3ec847752dbddad8460d27f4d051952bc46fa54f
Reviewed-on: https://chromium-review.googlesource.com/1147144Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Commit-Queue: Rohit Rao <rohitrao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577895}
parent f22de573
......@@ -326,12 +326,13 @@ const CGFloat kSpinnerButtonPadding = 18;
CollectionViewItem* item =
[self.collectionViewModel itemAtIndexPath:indexPath];
if (item.type == ItemTypeMessage) {
CardMultilineCell* messageCell =
base::mac::ObjCCastStrict<CardMultilineCell>(cell);
if (experimental_flags::IsSettingsUIRebootEnabled()) {
messageCell.textLabel.font =
[UIFont boldSystemFontOfSize:kUIKitMainFontSize];
} else {
// Changing the font weight may reflow the text onto a different number of
// lines, but the collection view doesn't know that it needs to layout the
// cell again. Sidestep this bug by leaving the font at a normal weight
// under UIRefresh.
if (!experimental_flags::IsSettingsUIRebootEnabled()) {
CardMultilineCell* messageCell =
base::mac::ObjCCastStrict<CardMultilineCell>(cell);
messageCell.textLabel.font =
[[MDCTypography fontLoader] mediumFontOfSize:14];
}
......
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