Skip to content
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

Merged
merged 1 commit into from Mar 7, 2017

Conversation

bkmunar
Copy link
Contributor

@bkmunar bkmunar commented Mar 6, 2017

No description provided.

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
Copy link
Contributor

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))
Copy link
Contributor

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
Copy link
Contributor

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

@farhanpatel
Copy link
Contributor

Also do you need to do this in the other Highlight cell too?

@bkmunar bkmunar merged commit 912ac23 into master Mar 7, 2017
@bkmunar bkmunar deleted the bkmunar/faviconHighlights branch March 7, 2017 00:01
jjSDET pushed a commit to jjSDET/firefox-ios that referenced this pull request Feb 13, 2024
…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>
isabelrios pushed a commit to isabelrios/firefox-ios that referenced this pull request Feb 19, 2024
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants