Commit 36db1e09 authored by redatawfik's avatar redatawfik Committed by Commit Bot

Fix TableViewTextCell background

-When TableViewTextCell is tapped the background for the cell turned to
gray while the background for the textLabel stays white.
-Removing the code which sets TableViewTextCell textLabel background
solves the problem.

Bug: 984545
Change-Id: I615041f21b29e4c93e7d6b98b87d40be02c636e8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1778043
Commit-Queue: Reda Tawfik <redatawfik@google.com>
Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Reviewed-by: default avatarJavier Ernesto Flores Robles <javierrobles@chromium.org>
Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#693185}
parent 483c4859
...@@ -46,13 +46,6 @@ ...@@ -46,13 +46,6 @@
self.accessibilityLabel ? self.accessibilityLabel : self.text; self.accessibilityLabel ? self.accessibilityLabel : self.text;
} }
// Decide cell.textLabel.backgroundColor in order:
// 1. styler.cellBackgroundColor;
// 2. styler.tableViewBackgroundColor.
cell.textLabel.backgroundColor = styler.cellBackgroundColor
? styler.cellBackgroundColor
: styler.tableViewBackgroundColor;
// Decide cell.textLabel.textColor in order: // Decide cell.textLabel.textColor in order:
// 1. this.textColor; // 1. this.textColor;
// 2. styler.cellTitleColor; // 2. styler.cellTitleColor;
......
...@@ -69,10 +69,13 @@ TEST_F(TableViewTextItemTest, ConfigureCellWithStyler) { ...@@ -69,10 +69,13 @@ TEST_F(TableViewTextItemTest, ConfigureCellWithStyler) {
ChromeTableViewStyler* styler = [[ChromeTableViewStyler alloc] init]; ChromeTableViewStyler* styler = [[ChromeTableViewStyler alloc] init];
UIColor* testTextColor = UIColor.redColor; UIColor* testTextColor = UIColor.redColor;
styler.cellTitleColor = testTextColor; styler.cellTitleColor = testTextColor;
UIColor* testBackgroundColor = UIColor.blueColor; UIColor* testCellBackgroundColor = UIColor.blueColor;
styler.tableViewBackgroundColor = testBackgroundColor; styler.tableViewBackgroundColor = testCellBackgroundColor;
[item configureCell:cell withStyler:styler]; [item configureCell:cell withStyler:styler];
EXPECT_NSEQ(testBackgroundColor, cell.textLabel.backgroundColor); EXPECT_NSEQ(testCellBackgroundColor, cell.backgroundColor);
// TextLabel.backgroundColor has to be clear in (IOS 13) as the cell
// background color doesn't apply to the textlabel background color anymore.
EXPECT_NSEQ(UIColor.clearColor, cell.textLabel.backgroundColor);
EXPECT_NSEQ(testTextColor, cell.textLabel.textColor); EXPECT_NSEQ(testTextColor, cell.textLabel.textColor);
} }
......
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