Commit c1be048d authored by Robbie Gibson's avatar Robbie Gibson Committed by Chromium LUCI CQ

[iOS] Fix thumb strip thumbnails overlapping status bar

The major issue here was that the height calculation in
horizontal_layout.mm wasn't taking the collection view's contentInsets
into account when calculating the sectionInset. This meant that the
resulting layout was too large. Specifically, the vertical sectionInsets
+ contentInset + item height ended up larger than the collection view's
height, causing the layout to be incorrect.

Fixed: 1155601
Change-Id: Ie9594fec2762239963bc90c41bf07f8caa42bf83
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2587038Reviewed-by: default avataredchin <edchin@chromium.org>
Commit-Queue: Robbie Gibson <rkgibson@google.com>
Cr-Commit-Position: refs/heads/master@{#836196}
parent 843e395a
......@@ -27,12 +27,14 @@
[super prepareLayout];
self.itemSize = kGridCellSizeSmall;
CGFloat height = CGRectGetHeight(self.collectionView.bounds);
CGFloat spacing = kGridLayoutLineSpacingCompactCompactLimitedWidth;
CGFloat topInset = spacing + kGridCellSelectionRingGapWidth +
kGridCellSelectionRingTintWidth;
// Use the height of the available content area.
CGFloat height = CGRectGetHeight(UIEdgeInsetsInsetRect(
self.collectionView.bounds, self.collectionView.contentInset));
CGFloat topInset =
kGridCellSelectionRingGapWidth + kGridCellSelectionRingTintWidth;
self.sectionInset = UIEdgeInsets{
topInset, spacing, height - self.itemSize.height - 2 * topInset, spacing};
topInset, spacing, height - self.itemSize.height - topInset, spacing};
self.minimumLineSpacing = kGridLayoutLineSpacingRegularRegular;
}
......
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