diff --git a/Signal/src/ViewControllers/HomeView/HomeViewCell.swift b/Signal/src/ViewControllers/HomeView/HomeViewCell.swift index 9c35431a07..3c66238b60 100644 --- a/Signal/src/ViewControllers/HomeView/HomeViewCell.swift +++ b/Signal/src/ViewControllers/HomeView/HomeViewCell.swift @@ -166,11 +166,14 @@ public class HomeViewCell: UITableViewCell { private func commonInit() { self.backgroundColor = Theme.backgroundColor - let v = UIView(frame: contentView.bounds) - v.autoresizingMask = [.flexibleWidth, .flexibleHeight] + var v = UIView(frame: contentView.bounds) v.backgroundColor = Theme.tableCell2MultiSelectedBackgroundColor multipleSelectionBackgroundView = v + v = UIView(frame: contentView.bounds) + v.backgroundColor = Theme.tableCell2SelectedBackgroundColor + selectedBackgroundView = v + contentView.addSubview(outerHStack) outerHStack.shouldDeactivateConstraints = false outerHStack.autoPinEdge(toSuperviewEdge: .leading) @@ -178,7 +181,6 @@ public class HomeViewCell: UITableViewCell { outerHStack.autoPinHeightToSuperview() self.selectionStyle = .default - selectedBackgroundView?.backgroundColor = Theme.tableCell2SelectedBackgroundColor } // This method can be invoked from any thread. @@ -316,7 +318,7 @@ public class HomeViewCell: UITableViewCell { func configure(cellContentToken: HVCellContentToken, asyncAvatarLoadingAllowed: Bool = true) { AssertIsOnMainThread() - OWSTableItem.configureCell(self) + OWSTableItem.configureCellLabels(self) self.preservesSuperviewLayoutMargins = false self.contentView.preservesSuperviewLayoutMargins = false diff --git a/SignalUI/ViewControllers/OWSTableViewController.h b/SignalUI/ViewControllers/OWSTableViewController.h index 2cd552a566..fec6e4f405 100644 --- a/SignalUI/ViewControllers/OWSTableViewController.h +++ b/SignalUI/ViewControllers/OWSTableViewController.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2021 Open Whisper Systems. All rights reserved. +// Copyright (c) 2022 Open Whisper Systems. All rights reserved. // #import @@ -86,6 +86,7 @@ typedef BOOL (^OWSTableSwitchBlock)(void); + (UITableViewCell *)newCell; + (void)configureCell:(UITableViewCell *)cell; ++ (void)configureCellLabels:(UITableViewCell *)cell; + (OWSTableItem *)itemWithTitle:(NSString *)title actionBlock:(nullable OWSTableActionBlock)actionBlock NS_SWIFT_NAME(init(title:actionBlock:)); diff --git a/SignalUI/ViewControllers/OWSTableViewController.m b/SignalUI/ViewControllers/OWSTableViewController.m index aed4481c9c..59e781eebd 100644 --- a/SignalUI/ViewControllers/OWSTableViewController.m +++ b/SignalUI/ViewControllers/OWSTableViewController.m @@ -1,5 +1,5 @@ // -// Copyright (c) 2021 Open Whisper Systems. All rights reserved. +// Copyright (c) 2022 Open Whisper Systems. All rights reserved. // #import "OWSTableViewController.h" @@ -140,14 +140,18 @@ const CGFloat kOWSTable_DefaultCellHeight = 45.f; return cell; } -+ (void)configureCell:(UITableViewCell *)cell ++ (void)configureCellLabels:(UITableViewCell *)cell { - cell.backgroundColor = Theme.backgroundColor; cell.textLabel.font = OWSTableItem.primaryLabelFont; cell.textLabel.textColor = Theme.primaryTextColor; cell.detailTextLabel.textColor = Theme.secondaryTextAndIconColor; cell.detailTextLabel.font = OWSTableItem.accessoryLabelFont; +} ++ (void)configureCell:(UITableViewCell *)cell +{ + cell.backgroundColor = Theme.backgroundColor; + [self configureCellLabels:cell]; UIView *selectedBackgroundView = [UIView new]; selectedBackgroundView.backgroundColor = Theme.cellSelectedColor; cell.selectedBackgroundView = selectedBackgroundView;