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

[ios] Adds visual effect to Disclosure HeaderFooterView

The background added for optimization to DisclosureHeaderFooterView
was removing the VisualEffect being set in the parent class. This CL
moves the optimization background to the parent class in case there's
no visual effect being set.

Bug: 865890
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I7b50ed65fc47c93b6548ca2eb60bd139071c8f28
Reviewed-on: https://chromium-review.googlesource.com/1171856Reviewed-by: default avatarKurt Horimoto <kkhorimoto@chromium.org>
Commit-Queue: Sergio Collazos <sczs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582688}
parent 9f7cd31f
...@@ -45,9 +45,6 @@ constexpr float kRotationNinetyCCW = -(90 / 180.0) * M_PI; ...@@ -45,9 +45,6 @@ constexpr float kRotationNinetyCCW = -(90 / 180.0) * M_PI;
DisclosureDirection direction = DisclosureDirection direction =
self.collapsed ? DisclosureDirectionUp : DisclosureDirectionDown; self.collapsed ? DisclosureDirectionUp : DisclosureDirectionDown;
[header setInitialDirection:direction]; [header setInitialDirection:direction];
// Use colors from styler if available.
if (styler.tableViewBackgroundColor)
header.contentView.backgroundColor = styler.tableViewBackgroundColor;
if (styler.headerFooterTitleColor) if (styler.headerFooterTitleColor)
header.titleLabel.textColor = styler.headerFooterTitleColor; header.titleLabel.textColor = styler.headerFooterTitleColor;
} }
......
...@@ -25,9 +25,18 @@ ...@@ -25,9 +25,18 @@
DCHECK([headerFooter class] == self.cellClass); DCHECK([headerFooter class] == self.cellClass);
headerFooter.accessibilityTraits = self.accessibilityTraits; headerFooter.accessibilityTraits = self.accessibilityTraits;
headerFooter.accessibilityIdentifier = self.accessibilityIdentifier; headerFooter.accessibilityIdentifier = self.accessibilityIdentifier;
UIVisualEffectView* visualEffect = [[UIVisualEffectView alloc] // Use the styler tableViewSectionHeaderBlurEffect if available, if not use
initWithEffect:styler.tableViewSectionHeaderBlurEffect]; // the styler tableViewBackgroundColor (as a performance optimization) if
headerFooter.backgroundView = visualEffect; // available.
if (styler.tableViewSectionHeaderBlurEffect) {
UIVisualEffectView* visualEffect = [[UIVisualEffectView alloc]
initWithEffect:styler.tableViewSectionHeaderBlurEffect];
headerFooter.backgroundView = visualEffect;
} else if (styler.tableViewBackgroundColor) {
UIView* backgroundView = [[UIView alloc] init];
backgroundView.backgroundColor = styler.tableViewBackgroundColor;
headerFooter.backgroundView = backgroundView;
}
} }
- (CGFloat)headerHeightForWidth:(CGFloat)width { - (CGFloat)headerHeightForWidth:(CGFloat)width {
......
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