Commit 062ca4c1 authored by Mark Cogan's avatar Mark Cogan Committed by Commit Bot

[iOS] Fix scroll view jumping in tab grid.

A previous CL arranged for the current panel of the tab grid to update
whenever the view layout was updated; this happens frequently when
scrolling, which results in a "jump" as soon as the scroll view passes
the threshold for changing panels. This CL fixes that.

Bug: 852247
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I7b2e56fdafff5cf156475563f04c5db0fd8964e6
Reviewed-on: https://chromium-review.googlesource.com/1099378Reviewed-by: default avataredchin <edchin@chromium.org>
Commit-Queue: edchin <edchin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#566902}
parent e62c8302
...@@ -149,8 +149,10 @@ NSUInteger GetPageIndexFromPage(TabGridPage page) { ...@@ -149,8 +149,10 @@ NSUInteger GetPageIndexFromPage(TabGridPage page) {
- (void)viewWillLayoutSubviews { - (void)viewWillLayoutSubviews {
[super viewWillLayoutSubviews]; [super viewWillLayoutSubviews];
// Call the current page setter to sync the scroll view offset to the current // Call the current page setter to sync the scroll view offset to the current
// page value. Don't animate this. // page value, if the scroll view isn't scrolling. Don't animate this.
self.currentPage = _currentPage; if (!self.scrollView.dragging && !self.scrollView.decelerating) {
self.currentPage = _currentPage;
}
// The content inset of the tab grids must be modified so that the toolbars // The content inset of the tab grids must be modified so that the toolbars
// do not obscure the tabs. This may change depending on orientation. // do not obscure the tabs. This may change depending on orientation.
UIEdgeInsets contentInset = UIEdgeInsetsZero; UIEdgeInsets contentInset = UIEdgeInsetsZero;
......
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