-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
frontpage-recommendations-externalAd-layout #1371
Conversation
7b87ec9
to
7f470b1
Compare
@@ -176,6 +183,7 @@ public class ExternalAdRecommendationCell: UICollectionViewCell, AdRecommendatio | |||
titleLabel.topAnchor.constraint(equalTo: subtitleLabel.bottomAnchor, constant: ExternalAdRecommendationCell.titleTopMargin), | |||
titleLabel.leadingAnchor.constraint(equalTo: contentView.leadingAnchor), | |||
titleLabel.trailingAnchor.constraint(equalTo: contentView.trailingAnchor), | |||
titleLabel.bottomAnchor.constraint(equalTo: contentView.bottomAnchor), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job finding the bug 🎉
let imageHeightMinimumConstraint = imageContentView.heightAnchor.constraint(equalTo: imageContentView.widthAnchor, multiplier: ExternalAdRecommendationCell.minImageAspectRatio) | ||
let imageHeightMaximumConstraint = imageContentView.heightAnchor.constraint(lessThanOrEqualTo: imageContentView.widthAnchor, multiplier: ExternalAdRecommendationCell.maxImageAspectRatio) | ||
|
||
imageHeightMinimumConstraint.priority = .defaultHigh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder why we set these min and max height constraints, instead of setting the actual height based on image size when configuring the cell with the model 🤔 But I see we do the same in StandardAdRecommendationCell
, so if it works there it should work here as well 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when we got a new report, i decided to revert my previous changes from here and attempt to fix it from scratch
then i noticed that the label had a constraint missing! added it and it seemed to make auto layout happy!
now i wonder why i did not see it last time...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome 👍 haha not easy to see this stuff 👁️
@@ -176,6 +183,7 @@ public class ExternalAdRecommendationCell: UICollectionViewCell, AdRecommendatio | |||
titleLabel.topAnchor.constraint(equalTo: subtitleLabel.bottomAnchor, constant: ExternalAdRecommendationCell.titleTopMargin), | |||
titleLabel.leadingAnchor.constraint(equalTo: contentView.leadingAnchor), | |||
titleLabel.trailingAnchor.constraint(equalTo: contentView.trailingAnchor), | |||
titleLabel.bottomAnchor.constraint(equalTo: contentView.bottomAnchor), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome!
Why?
the previous fix worked only for FinniversKit
In the actual app we still had issues from time to time due to a missing constraint
What?
reverts #1324 and fixes the actual issue
Version Change
UI Changes