Commit 281486c2 authored by Nazerke's avatar Nazerke Committed by Commit Bot

[ios] UI Polish Omnibox: add animation to DSE favicon.

Current behaviour:
When focusing the Omnibox, the icon on the far left (G icon, Favicon,
e.g.) has no animation.

Intended behaviour:
The icon on the far left should have a short animation starting from an
opacity of 0 and a scale of 0 towards an opacity of 100 and a scale of 1.

Bug: none.
Change-Id: I06a90707db4e496fe1aef032e2ce110f392e3d81
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2339531Reviewed-by: default avatarStepan Khapugin <stkhapugin@chromium.org>
Commit-Queue: Nazerke Kalidolda <nazerke@google.com>
Cr-Commit-Position: refs/heads/master@{#796931}
parent e9a215ef
...@@ -37,6 +37,9 @@ ...@@ -37,6 +37,9 @@
// Sets the alpha level of the leading image view. // Sets the alpha level of the leading image view.
- (void)setLeadingImageAlpha:(CGFloat)alpha; - (void)setLeadingImageAlpha:(CGFloat)alpha;
// Sets the scale of the leading image view.
- (void)setLeadingImageScale:(CGFloat)scaleValue;
// Asks the container view to attch any layout guides to its views. // Asks the container view to attch any layout guides to its views.
- (void)attachLayoutGuides; - (void)attachLayoutGuides;
......
...@@ -117,6 +117,10 @@ const CGFloat kTextFieldClearButtonTrailingOffset = 4; ...@@ -117,6 +117,10 @@ const CGFloat kTextFieldClearButtonTrailingOffset = 4;
self.leadingImageView.alpha = alpha; self.leadingImageView.alpha = alpha;
} }
- (void)setLeadingImageScale:(CGFloat)scaleValue {
self.leadingImageView.transform =
CGAffineTransformMakeScale(scaleValue, scaleValue);
}
#pragma mark - private #pragma mark - private
- (void)setupLeadingImageViewWithTint:(UIColor*)iconTint { - (void)setupLeadingImageViewWithTint:(UIColor*)iconTint {
......
...@@ -364,7 +364,19 @@ const CGFloat kClearButtonSize = 28.0f; ...@@ -364,7 +364,19 @@ const CGFloat kClearButtonSize = 28.0f;
#pragma mark - EditViewAnimatee #pragma mark - EditViewAnimatee
- (void)setLeadingIconFaded:(BOOL)faded { - (void)setLeadingIconFaded:(BOOL)faded {
[self.view setLeadingImageAlpha:faded ? 0 : 1]; CATransition* transition = [CATransition animation];
transition.duration = 0.3;
transition.timingFunction = [CAMediaTimingFunction
functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionFade;
[self.view.layer addAnimation:transition forKey:nil];
if (faded) {
[self.view setLeadingImageAlpha:0];
[self.view setLeadingImageScale:0];
} else {
[self.view setLeadingImageAlpha:1];
[self.view setLeadingImageScale:1];
}
} }
- (void)setClearButtonFaded:(BOOL)faded { - (void)setClearButtonFaded:(BOOL)faded {
......
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