Commit ad7b791e by Dmitriy Stepanets

Fixed full screen short displaying on older devices

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