Commit ad7b791e by Dmitriy Stepanets

Fixed full screen short displaying on older devices

parent 687ec259
......@@ -58,6 +58,7 @@ class ShortsItemCell: UITableViewCell {
super.prepareForReuse()
// textContainer.backgroundColor = ShortsItemCell.kDefaultColor
// gradientView.update(color: ShortsItemCell.kDefaultColor)
contentView.backgroundColor = ThemeManager.currentTheme.baseBackgroundColor
}
override func layoutSubviews() {
......@@ -83,7 +84,6 @@ class ShortsItemCell: UITableViewCell {
let aspect = imageResponse.image.size.width / imageResponse.image.size.height
self.backgroundImageView.snp.remakeConstraints { remake in
remake.left.top.right.equalToSuperview()
remake.bottom.equalToSuperview().priority(.medium)
remake.width.equalTo(self.backgroundImageView.snp.height).multipliedBy(aspect)
}
......@@ -164,12 +164,14 @@ class ShortsItemCell: UITableViewCell {
//MARK:- Prepare
private extension ShortsItemCell {
func prepareForImageOnly() {
contentView.clipsToBounds = true
contentView.backgroundColor = ThemeManager.currentTheme.baseBackgroundColor
backgroundImageView.contentMode = .scaleAspectFit
backgroundImageView.clipsToBounds = true
contentView.addSubview(backgroundImageView)
backgroundImageView.snp.makeConstraints { make in
make.left.top.right.equalToSuperview()
make.bottom.equalToSuperview().priority(.medium)
make.width.equalTo(backgroundImageView.snp.height).multipliedBy(1)
}
}
......@@ -295,7 +297,7 @@ private extension ShortsItemCell {
make.width.equalTo(92)
make.height.equalTo(28)
make.left.equalToSuperview().inset(18)
make.bottom.equalToSuperview().inset(60)
make.centerY.equalTo(likeButton)
}
}
}
......
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