Commit ecf8d9af authored by sczs's avatar sczs Committed by Commit Bot

[ios] Anchors the locationBarStackView bottom to the toolbar

Since the locationBarContainer is expanded and its stackView is not, this CL creates a margin
constant and anchors the bottomAnchor to the toolbar bottomAnchor, this way the Y position of the
StackView is not changed during expansion or contraction.

Bug: 796482
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: I69aac20beb0a2b3b31d516b78da7b1b4ba3a6ab8
Reviewed-on: https://chromium-review.googlesource.com/841442Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Commit-Queue: Sergio Collazos <sczs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#526016}
parent c601c0d6
...@@ -35,6 +35,9 @@ extern const CGFloat kLocationBarShadowHeight; ...@@ -35,6 +35,9 @@ extern const CGFloat kLocationBarShadowHeight;
extern const CGFloat kLocationBarShadowInset; extern const CGFloat kLocationBarShadowInset;
extern const CGFloat kIcongnitoLocationBackgroundColor; extern const CGFloat kIcongnitoLocationBackgroundColor;
// Location bar StackView constraints.
extern const CGFloat klocationBarStackViewBottomMargin;
// Progress Bar Height. // Progress Bar Height.
extern const CGFloat kProgressBarHeight; extern const CGFloat kProgressBarHeight;
......
...@@ -25,6 +25,8 @@ const CGFloat kLocationBarShadowHeight = 2.0f; ...@@ -25,6 +25,8 @@ const CGFloat kLocationBarShadowHeight = 2.0f;
const CGFloat kLocationBarShadowInset = 1.0f; const CGFloat kLocationBarShadowInset = 1.0f;
const CGFloat kIcongnitoLocationBackgroundColor = 0x737373; const CGFloat kIcongnitoLocationBackgroundColor = 0x737373;
const CGFloat klocationBarStackViewBottomMargin = 8.0f;
const CGFloat kProgressBarHeight = 2.0f; const CGFloat kProgressBarHeight = 2.0f;
const CGFloat kToolsMenuButtonWidth = 44.0f; const CGFloat kToolsMenuButtonWidth = 44.0f;
......
...@@ -572,22 +572,18 @@ ...@@ -572,22 +572,18 @@
// LocationBarContainer View. // LocationBarContainer View.
UILayoutGuide* locationBarContainerSafeAreaGuide = UILayoutGuide* locationBarContainerSafeAreaGuide =
SafeAreaLayoutGuideForView(self.locationBarContainer); SafeAreaLayoutGuideForView(self.locationBarContainer);
NSLayoutConstraint* locationBarContainerStackViewTopConstraint =
[self.locationBarContainerStackView.topAnchor
constraintEqualToAnchor:self.locationBarContainer.topAnchor];
[NSLayoutConstraint activateConstraints:@[ [NSLayoutConstraint activateConstraints:@[
[self.locationBarContainerStackView.bottomAnchor [self.locationBarContainerStackView.bottomAnchor
constraintEqualToAnchor:self.locationBarContainer.bottomAnchor], constraintEqualToAnchor:self.view.bottomAnchor
constant:-(klocationBarStackViewBottomMargin +
kLocationBarVerticalMargin)],
[self.locationBarContainerStackView.trailingAnchor [self.locationBarContainerStackView.trailingAnchor
constraintEqualToAnchor:locationBarContainerSafeAreaGuide constraintEqualToAnchor:locationBarContainerSafeAreaGuide
.trailingAnchor], .trailingAnchor],
[self.locationBarContainerStackView.leadingAnchor [self.locationBarContainerStackView.leadingAnchor
constraintEqualToAnchor:locationBarContainerSafeAreaGuide constraintEqualToAnchor:locationBarContainerSafeAreaGuide
.leadingAnchor], .leadingAnchor],
locationBarContainerStackViewTopConstraint,
]]; ]];
[self.regularToolbarConstraints
addObject:locationBarContainerStackViewTopConstraint];
} }
#pragma mark - Components Setup #pragma mark - Components Setup
...@@ -1064,9 +1060,6 @@ ...@@ -1064,9 +1060,6 @@
constraintEqualToAnchor:self.view.leadingAnchor], constraintEqualToAnchor:self.view.leadingAnchor],
[self.locationBarContainer.trailingAnchor [self.locationBarContainer.trailingAnchor
constraintEqualToAnchor:self.view.trailingAnchor], constraintEqualToAnchor:self.view.trailingAnchor],
[self.locationBarContainerStackView.topAnchor
constraintEqualToAnchor:self.topSafeAnchor
constant:kExpandedLocationBarVerticalMargin],
]; ];
} }
return _expandedToolbarConstraints; return _expandedToolbarConstraints;
......
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