Commit a289922b authored by Gauthier Ambard's avatar Gauthier Ambard Committed by Commit Bot

[iOS] Change the NTP animation of the location bar

This CL changes the way to NTP is animating the appearance of the
location bar in the toolbar when the device has a regular width.
It uses a transform instead of changing the bottom constraint of the
location bar.

Bug: 906176
Change-Id: Ia110cafd9d2093a82487b2e3c342337c8cf7ef12
Reviewed-on: https://chromium-review.googlesource.com/c/1341911Reviewed-by: default avatarJustin Cohen <justincohen@chromium.org>
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609340}
parent 8d0984eb
......@@ -78,8 +78,13 @@
- (void)setScrollProgressForTabletOmnibox:(CGFloat)progress {
[super setScrollProgressForTabletOmnibox:progress];
self.view.locationBarBottomConstraint.constant =
[self verticalMarginForLocationBarForFullscreenProgress:1] * progress;
if (progress == 1) {
self.view.locationBarContainer.transform = CGAffineTransformIdentity;
} else {
self.view.locationBarContainer.transform = CGAffineTransformMakeTranslation(
0, [self verticalMarginForLocationBarForFullscreenProgress:1] *
(progress - 1));
}
self.view.locationBarContainer.alpha = progress;
// When the locationBarContainer is hidden, show the |fakeOmniboxTarget|.
......
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