Fix background-color (IOS-141)

This commit is contained in:
Nathan Mattes 2023-09-18 23:10:59 +02:00
parent c1b80a73c2
commit 68dc99004c
4 changed files with 12 additions and 3 deletions

View File

@ -6,6 +6,14 @@ import MastodonAsset
class SearchResultDefaultSectionTableViewCell: UITableViewCell {
static let reuseIdentifier = "SearchResultDefaultSectionTableViewCell"
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
backgroundColor = .secondarySystemGroupedBackground
}
required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") }
func configure(item: SearchResultOverviewItem.DefaultSectionEntry) {
var content = UIListContentConfiguration.cell()
content.image = item.icon

View File

@ -17,6 +17,7 @@ class SearchResultsProfileTableViewCell: UITableViewCell {
contentView.addSubview(condensedUserView)
condensedUserView.pinToParent()
backgroundColor = .secondarySystemGroupedBackground
}
required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") }

View File

@ -34,7 +34,7 @@ class SearchHistoryUserCollectionViewCell: UICollectionViewCell {
if state.isHighlighted || state.isSelected {
return ThemeService.shared.currentTheme.value.tableViewCellSelectionBackgroundColor
} else {
return ThemeService.shared.currentTheme.value.secondarySystemGroupedBackgroundColor
return .secondarySystemGroupedBackground
}
}

View File

@ -48,13 +48,13 @@ extension SearchHistorySection {
var backgroundConfiguration = UIBackgroundConfiguration.listGroupedCell()
backgroundConfiguration.backgroundColorTransformer = .init { [weak cell] _ in
guard let state = cell?.configurationState else {
return ThemeService.shared.currentTheme.value.secondarySystemGroupedBackgroundColor
return .secondarySystemGroupedBackground
}
if state.isHighlighted || state.isSelected {
return ThemeService.shared.currentTheme.value.tableViewCellSelectionBackgroundColor
}
return ThemeService.shared.currentTheme.value.secondarySystemGroupedBackgroundColor
return .secondarySystemGroupedBackground
}
cell.backgroundConfiguration = backgroundConfiguration
}