Commit 57f53584 authored by Gauthier Ambard's avatar Gauthier Ambard Committed by Commit Bot

Invalidate layout when NTP will appear

When the NTP will appear, the layout needs to be invalidated. It ensures
that the insets for the Most Visited section are correct when the device
is rotated while another screen (e.g. settings) is presented in front of
the NTP.

Bug: 771149
Change-Id: If8c926fbb0e5cca860b31c4ccc7b672fe49b9e80
Reviewed-on: https://chromium-review.googlesource.com/726082Reviewed-by: default avatarJean-François Geyelin <jif@chromium.org>
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#510069}
parent 9f1fcdf2
......@@ -248,6 +248,14 @@ BOOL ShouldCellsBeFullWidth(UITraitCollection* collection) {
}
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
// Reload data to ensure the Most Visited tiles are correctly positionned, in
// particular during a rotation while a ViewController is presented in front
// of the NTP.
[self.collectionView.collectionViewLayout invalidateLayout];
}
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
// Resize the collection as it might have been rotated while not being
......
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