Commit 9adb38cd authored by Justin Cohen's avatar Justin Cohen Committed by Commit Bot

[ios] More tweaks to content suggestions icons, font and blur.

Bug: 819223
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: I41edb5310f0529f9d770f5b415cd6f5179a89d1a
Reviewed-on: https://chromium-review.googlesource.com/980672Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#546098}
parent 4f0c4816
......@@ -112,8 +112,11 @@ const int kLinkColorRGB = 0x5595FE;
+ (void)configureLabel:(UILabel*)label withText:(NSString*)text {
label.numberOfLines = 0;
label.textColor = [[MDCPalette greyPalette] tint700];
label.font = [MDCTypography italicFontFromFont:[MDCTypography captionFont]];
if (IsUIRefreshPhase1Enabled()) {
label.font = [UIFont preferredFontForTextStyle:UIFontTextStyleFootnote];
} else {
label.font = [MDCTypography italicFontFromFont:[MDCTypography captionFont]];
}
NSRange linkRange;
NSString* strippedText = ParseStringWithLink(text, &linkRange);
DCHECK_NE(NSNotFound, static_cast<NSInteger>(linkRange.location));
......
......@@ -83,8 +83,9 @@ const CGFloat kSearchIconLeftMargin = 9;
}
- (void)addViewsToSearchField:(UIView*)searchField {
UIBlurEffect* blurEffect = [[ToolbarButtonFactory alloc] initWithStyle:NORMAL]
.toolbarConfiguration.blurEffect;
ToolbarButtonFactory* buttonFactory =
[[ToolbarButtonFactory alloc] initWithStyle:NORMAL];
UIBlurEffect* blurEffect = buttonFactory.toolbarConfiguration.blurEffect;
UIVisualEffectView* blur =
[[UIVisualEffectView alloc] initWithEffect:blurEffect];
blur.layer.cornerRadius = kAdaptiveLocationBarCornerRadius;
......@@ -92,12 +93,20 @@ const CGFloat kSearchIconLeftMargin = 9;
blur.translatesAutoresizingMaskIntoConstraints = NO;
AddSameConstraints(blur, searchField);
UIVisualEffect* vibrancy = [buttonFactory.toolbarConfiguration
vibrancyEffectForBlurEffect:blurEffect];
UIVisualEffectView* vibrancyView =
[[UIVisualEffectView alloc] initWithEffect:vibrancy];
[searchField insertSubview:vibrancyView atIndex:1];
vibrancyView.translatesAutoresizingMaskIntoConstraints = NO;
AddSameConstraints(vibrancyView, searchField);
UIView* backgroundContainer = [[UIView alloc] init];
backgroundContainer.userInteractionEnabled = NO;
backgroundContainer.backgroundColor =
UIColorFromRGB(content_suggestions::kSearchFieldBackgroundColor);
backgroundContainer.layer.cornerRadius = kAdaptiveLocationBarCornerRadius;
[searchField insertSubview:backgroundContainer atIndex:1];
[vibrancyView.contentView addSubview:backgroundContainer];
backgroundContainer.translatesAutoresizingMaskIntoConstraints = NO;
self.backgroundLeadingConstraint = [backgroundContainer.leadingAnchor
......@@ -116,7 +125,7 @@ const CGFloat kSearchIconLeftMargin = 9;
UIImage* search_icon = [UIImage imageNamed:@"ntp_search_icon"];
UIImageView* search_view = [[UIImageView alloc] initWithImage:search_icon];
[searchField addSubview:search_view];
[vibrancyView.contentView addSubview:search_view];
search_view.translatesAutoresizingMaskIntoConstraints = NO;
[NSLayoutConstraint activateConstraints:@[
[search_view.centerYAnchor
......
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