[iOS] Fix secondary toolbar animations.
The old implementation of |updateFootersForFullscreenProgress:| just updates the height constraint for the toolbar, which isn't actually applied to the model layer until the end of the runloop. In order to animate this change, the model layer must be updated from within the animation block, so |-layoutIfNeeded| is called to commit the new constraint value to the view hierarchy. Simply calling |-layoutIfNeeded| on the toolbar view itself will only animate the height, not the positioning. Since the positioning constraint is added to BVC.view, we'd need to force a full BVC layout to also animate the position correctly. However, since BVC is a heavy-weight view, and this is called for every scroll offset, calling |-layoutIfNeeded| on BVC.view may introduce performance regressions. This CL adds a container view for the secondary toolbar that has a constant frame equal to that of the secondary toolbar at a fullscreen progress of 1.0. That way, all the constraints that need to be animated are owned by the container and its subviews, so we can just call |-layoutIfNeeded| on the container rather than the entire browser view. Bug: 880656 Cq-Include-Trybots: luci.chromium.try:ios-simulator-cronet;luci.chromium.try:ios-simulator-full-configs Change-Id: Ia0520d4cbfb55846efa16282e5aefae6e7f11212 Reviewed-on: https://chromium-review.googlesource.com/1208713 Commit-Queue: Kurt Horimoto <kkhorimoto@chromium.org> Reviewed-by:Mark Cogan <marq@chromium.org> Cr-Commit-Position: refs/heads/master@{#590182}
Showing
Please register or sign in to comment