Commit 05a62e89 authored by Nazerke's avatar Nazerke Committed by Commit Bot

[ios] UI Polish Omnibox - Badges in the Location bar.

Current behaviour:
The animation to enter fullscreen makes the Incognito badge next to the
security icon appear as if it comes from the left. The animation to enter
fullscreen makes icons on the far right (Share icon/ Mic icon) and left
(Message badge/ Incognito badge) move towards the center before fading out
completely.

Intended behaviour:
There should be no x translation, when the Incognito badge appears, but
instead it should start animating from a scale of 0, while maintaining
the current fade behaviour. The icon should not move towards the centre,
but instead combine the current fadeout with a scale translation
towards 0.

Bug: none.
Change-Id: Ie4b4c6844aa0618366d16bacb5b29adc26e8e03e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2336837
Commit-Queue: Nazerke Kalidolda <nazerke@google.com>
Reviewed-by: default avatarStepan Khapugin <stkhapugin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#797237}
parent 47cfeff0
......@@ -49,6 +49,9 @@
// appropriately.
- (void)enableTrailingButton:(BOOL)enabled;
// The view containing the location label, and (sometimes) the location image
// view.
@property(nonatomic, strong) UIView* locationContainerView;
// The tappable button representing the location bar.
@property(nonatomic, strong) UIButton* locationButton;
// The label displaying the current location URL.
......
......@@ -47,10 +47,6 @@ const CGFloat kLocationLabelVerticalOffset = -1;
// The image view displaying the current location icon (i.e. http[s] status).
@property(nonatomic, strong) UIImageView* locationIconImageView;
// The view containing the location label, and (sometimes) the location image
// view.
@property(nonatomic, strong) UIView* locationContainerView;
// Leading constraint for locationContainerView when there is no BadgeView to
// its left.
@property(nonatomic, strong)
......
......@@ -273,8 +273,23 @@ const NSString* kScribbleOmniboxElementId = @"omnibox";
progress <= kFullscreenProgressBadgeViewThreshold;
[self.locationBarSteadyView
setFullScreenCollapsedMode:badgeViewShouldCollapse];
self.locationBarSteadyView.transform =
CGAffineTransform transform =
CGAffineTransformMakeScale(scaleValue, scaleValue);
self.locationBarSteadyView.locationContainerView.transform = transform;
self.locationBarSteadyView.trailingButton.transform = transform;
UIView* badgeView = self.locationBarSteadyView.badgeView;
badgeView.transform = transform;
// The translation value is added in order to move badgeView for |dx| created
// by the difference of the separate animation of the locationbar's views.
if (badgeViewShouldCollapse) {
CGFloat dx =
self.locationBarSteadyView.locationContainerView.frame.origin.x -
badgeView.frame.origin.x - badgeView.frame.size.width;
badgeView.transform =
CGAffineTransformTranslate(badgeView.transform, dx, 0);
}
}
- (void)updateForFullscreenEnabled:(BOOL)enabled {
......
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