deep-linking-sample/Apps/Wikipedia/WMF Framework/ArticleCollectionViewCell+Themeable.swift
Javier Cicchelli 9bcdaa697b [Setup] Basic project structure (#1)
This PR contains all the work related to setting up this project as required to implement the [Assignment](https://repo.rock-n-code.com/rock-n-code/deep-linking-assignment/wiki/Assignment) on top, as intended.

To summarise this work:
- [x] created a new **Xcode** project;
- [x] cloned the `Wikipedia` app and inserted it into the **Xcode** project;
- [x] created the `Locations` app and also, its `Libraries` package;
- [x] created the `Shared` package to share dependencies between the apps;
- [x] added a `Makefile` file and implemented some **environment** and **help** commands.

Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Reviewed-on: rock-n-code/deep-linking-assignment#1
2023-04-08 18:37:13 +00:00

33 lines
1.4 KiB
Swift

extension ArticleCollectionViewCell: Themeable {
open func apply(theme: Theme) {
let selected = isBatchEditing ? theme.colors.batchSelectionBackground : theme.colors.midBackground
setBackgroundColors(theme.colors.paperBackground, selected: selected)
imageView.backgroundColor = theme.colors.midBackground
titleLabel.textColor = theme.colors.primaryText
descriptionLabel.textColor = theme.colors.secondaryText
extractLabel?.textColor = theme.colors.primaryText
imageView.alpha = theme.imageOpacity
statusView.backgroundColor = theme.colors.warning
alertButton.tintColor = alertType == .downloading ? theme.colors.warning : theme.colors.error
alertButton.setTitleColor(alertButton.tintColor, for: .normal)
actionsView.apply(theme: theme)
batchEditSelectView?.apply(theme: theme)
updateSelectedOrHighlighted()
}
}
extension ArticleRightAlignedImageCollectionViewCell {
open override func apply(theme: Theme) {
super.apply(theme: theme)
bottomSeparator.backgroundColor = theme.colors.baseBackground
topSeparator.backgroundColor = theme.colors.baseBackground
}
}
extension ArticleFullWidthImageCollectionViewCell {
open override func apply(theme: Theme) {
super.apply(theme: theme)
saveButton.setTitleColor(theme.colors.link, for: .normal)
}
}