Commit d1631a74 authored by Robbie Gibson's avatar Robbie Gibson Committed by Commit Bot

[iOS][Dark Mode] Support dark mode in share extension

This CL adds dark mode colors to the share extension. Besides colors,
it also removes the blur effect view. Before, there was a blur effect
over the background. There weren't any other views behind it though, so
the blur just helped color the background. Now, all the colors are
chrome-specific colors, so the background can be colored automatically.
Screenshots can be found in the linked bug.

Also, when building on iOS 13, the default presentation style for the
extension has changed to automatic, so the dimmed background is now
added automatically.

Finally, this modernizes some parts of share_extension_view.mm.

Bug: 992391
Change-Id: I16e5321ebc9018b41bfe617ad304fd3c3b6bb32e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1748754
Commit-Queue: Robbie Gibson <rkgibson@google.com>
Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#686358}
parent e010651f
......@@ -31,6 +31,7 @@ group("resources") {
":red_color",
":red_dark_color",
":scrim_background_color",
":separator_color",
":solid_button_text_color",
":table_view_row_highlight_color",
":table_view_row_highlight_dark_color",
......@@ -198,6 +199,12 @@ colorset("scrim_background_color") {
]
}
colorset("separator_color") {
sources = [
"separator_color.colorset/Contents.json",
]
}
colorset("solid_button_text_color") {
sources = [
"solid_button_text_color.colorset/Contents.json",
......
{
"info" : {
"version" : 1,
"author" : "xcode"
},
"colors" : [
{
"idiom" : "universal",
"color" : {
"color-space" : "display-p3",
"components" : {
"red" : "0xE8",
"alpha" : "1.000",
"blue" : "0xEC",
"green" : "0xEA"
}
}
},
{
"idiom" : "universal",
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "display-p3",
"components" : {
"red" : "0x47",
"alpha" : "1.000",
"blue" : "0x50",
"green" : "0x4C"
}
}
}
]
}
\ No newline at end of file
......@@ -18,6 +18,7 @@ extern NSString* const kMDCInkColor;
// Color used to tint placeholder images and icons.
extern NSString* const kPlaceholderImageTintColor;
extern NSString* const kScrimBackgroundColor;
extern NSString* const kSeparatorColor;
extern NSString* const kSolidButtonTextColor;
extern NSString* const kTableViewRowHighlightColor;
extern NSString* const kTextPrimaryColor;
......
......@@ -16,6 +16,7 @@ NSString* const kFaviconBackgroundColor = @"favicon_background_color";
NSString* const kMDCInkColor = @"mdc_ink_color";
NSString* const kPlaceholderImageTintColor = @"placeholder_image_tint_color";
NSString* const kScrimBackgroundColor = @"scrim_background_color";
NSString* const kSeparatorColor = @"separator_color";
NSString* const kSolidButtonTextColor = @"solid_button_text_color";
NSString* const kTableViewRowHighlightColor = @"table_view_row_highlight_color";
NSString* const kTextPrimaryColor = @"text_primary_color";
......
......@@ -53,6 +53,7 @@ ios_appex_bundle("share_extension") {
"//ios/chrome/common/app_group",
"//ios/chrome/common/app_group:client",
"//ios/chrome/common/app_group:command",
"//ios/chrome/common/colors",
]
bundle_deps_filter = [ "//third_party/icu:icudata" ]
......
......@@ -88,7 +88,12 @@ const CGFloat kMediumAlpha = 0.5;
// This view shadows the screen under the share extension.
UIView* maskView = [[UIView alloc] initWithFrame:CGRectZero];
[self setMaskView:maskView];
self.maskView = maskView;
// On iOS 13, the default share extension presentation style already has a
// mask behind the view.
if (@available(iOS 13, *)) {
self.maskView.hidden = YES;
}
[self.maskView
setBackgroundColor:[UIColor colorWithWhite:0 alpha:kMediumAlpha]];
[self.view addSubview:self.maskView];
......
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