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
Bug 1344783 - Make the highlight cells have similar favicons to TopSites #2496
Conversation
self.siteImageView.image = FaviconFetcher.getDefaultFavicon(url) | ||
self.siteImageView.backgroundColor = FaviconFetcher.getDefaultColor(url) | ||
} | ||
self.siteImageView.setIcon(site.icon, forURL: URL(string: (site.icon?.url ?? site.url)), completed: { (color, url) in |
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.
You can use the method that lets you pass the site in. That should work instead of you having to use this method.
self.siteImageView.backgroundColor = FaviconFetcher.getDefaultColor(url) | ||
} | ||
self.siteImageView.setIcon(site.icon, forURL: URL(string: (site.icon?.url ?? site.url)), completed: { (color, url) in | ||
self.siteImageView.image = self.siteImageView.image?.createScaled(CGSize(width: 32, height: 32)) |
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.
Use weak self here. We've had a crash related to this before.
Also the CGSize(32,32) should be a UX static var.
} | ||
self.siteImageView.setIcon(site.icon, forURL: URL(string: (site.icon?.url ?? site.url)), completed: { (color, url) in | ||
self.siteImageView.image = self.siteImageView.image?.createScaled(CGSize(width: 32, height: 32)) | ||
self.siteImageView.contentMode = .center |
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.
You shouldnt need to center it in the closure. You can do this outside
Also do you need to do this in the other Highlight cell too? |
a00ac60
to
1a497b8
Compare
…heme Settings (mozilla-mobile#2621) * Fixes mozilla-mobile#2496 - Collect Telemetry for Light / Dark Mode Theme Settings * Fixes mozilla-mobile#2496 - Collect Telemetry for Light / Dark Mode Theme Settings Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…heme Settings (mozilla-mobile#2621) * Fixes mozilla-mobile#2496 - Collect Telemetry for Light / Dark Mode Theme Settings * Fixes mozilla-mobile#2496 - Collect Telemetry for Light / Dark Mode Theme Settings Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
No description provided.