Closed Bug 1320775 Opened 8 years ago Closed 8 years ago

[AS] [TopSites] Default top sites need good icons

Categories

(Firefox for Android Graveyard :: General, defect, P1)

defect

Tracking

(firefox54 verified)

VERIFIED FIXED
Firefox 54
Tracking Status
firefox54 --- verified

People

(Reporter: Grisha, Assigned: ahunt)

References

Details

(Whiteboard: [MobileAS])

Attachments

(4 files, 1 obsolete file)

Currently we're displaying basic generated icons. Ideally we want to display real favicons for the default top sites, similar to what the "classic" top sites do.
This is bug 1312026. I'll close the other one.
AFAICS suggested sites can also be provided by distributions: we can easily provide good icons for our own suggested-sites, but distributions would have to change to provide icons (and I'm guessing that's not something we want to force). I'm wondering if we should instead reuse the touch-tiles to generate favicons (the touch tiles are actually a combination of an image plus a background - and we could generate a "favicon" to insert into the cache from there)? That could be done when suggested sites are loaded in SuggestedSites.java.
Assignee: nobody → ahunt
Iteration: --- → 1.15
Priority: P2 → P1
(In reply to Andrzej Hunt :ahunt from comment #3) > AFAICS suggested sites can also be provided by distributions: we can easily > provide good icons for our own suggested-sites, but distributions would have > to change to provide icons (and I'm guessing that's not something we want to > force). > > I'm wondering if we should instead reuse the touch-tiles to generate > favicons (the touch tiles are actually a combination of an image plus a > background - and we could generate a "favicon" to insert into the cache from > there)? That could be done when suggested sites are loaded in > SuggestedSites.java. The touchicons don't really fit well in AS topsites (they're designed for bigger spaces), so we definitely want normal icons for those - I'm still not sure what to do about distribution-owned suggested sites.
(In reply to Andrzej Hunt :ahunt from comment #4) > The touchicons don't really fit well in AS topsites (they're designed for > bigger spaces), so we definitely want normal icons for those - I'm still not > sure what to do about distribution-owned suggested sites. But that's what iOS is doing, at least for old topsites: https://support.cdn.mozilla.net/media/uploads/gallery/images/2016-03-21-15-00-34-9aac9a.png So I guess we could at least try this.
Attached image as_suggested_sites_tileIcons.png (obsolete) —
In conjunction with Bug 1324028, using the tile resources doesn't look too bad, see attached screenshot (aspect ratios need fixing...). I think I'll stick with this approach.
And an updated screenshot: the facebook icon is what is shown once facebook.com has actually been visited (i.e. site-supplied icons override the bundled icons). The remaining icons are the bundled ones: they look a bit small - it would be nice to boost the app-wide favicon size to improve this, especially since we're now showing favicons larger than before, but that's probably best to discuss in a separate bug (the SuggestedSiteLoader actually produces favicons that are more than large enough to fill the whole card, the Favicon pipeline and layouts then scale that down).
Attachment #8833099 - Attachment is obsolete: true
(In reply to Andrzej Hunt :ahunt from comment #7) > And an updated screenshot: the facebook icon is what is shown once > facebook.com has actually been visited (i.e. site-supplied icons override > the bundled icons). Let's file a separate bug for considering using our shipped icons over the downloaded ones: The ones we ship should be always good. > The remaining icons are the bundled ones: they look a > bit small - it would be nice to boost the app-wide favicon size to improve > this, especially since we're now showing favicons larger than before There should be a bug for updating our shipped icosn to match the new AS aspect ratio.
Comment on attachment 8833163 [details] Bug 1320775 - Pre: move favicon colour fading to color generator https://reviewboard.mozilla.org/r/109392/#review111534
Attachment #8833163 - Flags: review?(s.kaspari) → review+
Comment on attachment 8833163 [details] Bug 1320775 - Pre: move favicon colour fading to color generator https://reviewboard.mozilla.org/r/109392/#review111536 ::: mobile/android/base/java/org/mozilla/gecko/icons/processing/ColorProcessor.java:31 (Diff revision 1) > return; > } > > try { > final Palette palette = Palette.from(response.getBitmap()).generate(); > - response.updateColor(palette.getVibrantColor(DEFAULT_COLOR)); > + response.updateColor(palette.getVibrantColor(DEFAULT_COLOR) & 0x7FFFFFFF); Do we need to update TestColorProcessor?
Comment on attachment 8833164 [details] Bug 1320775 - Use bundled touch-tiles as favicons for suggested sites https://reviewboard.mozilla.org/r/109394/#review111538 ::: mobile/android/base/java/org/mozilla/gecko/icons/loader/SuggestedSiteLoader.java:22 (Diff revision 1) > +import org.mozilla.gecko.icons.IconRequest; > +import org.mozilla.gecko.icons.IconResponse; > + > +import java.io.IOException; > + > +public class SuggestedSiteLoader implements IconLoader { Can we add unit tests? ::: mobile/android/base/java/org/mozilla/gecko/icons/loader/SuggestedSiteLoader.java:39 (Diff revision 1) > + } > + > + return null; > + } > + > + private IconResponse prepareIcon(final Context context, final String siteURL) { The name 'prepareIcon' is a bit missleading in a "loader" and not a "preparer". ::: mobile/android/base/java/org/mozilla/gecko/icons/loader/SuggestedSiteLoader.java:60 (Diff revision 1) > + // Our favicon pipeline and layout code assumes a square icon - so we hack our supplied > + // icons into a square shape > + final int heightWidth = Math.max(foreground.getHeight(), foreground.getWidth()); > + > + final Bitmap output = Bitmap.createBitmap(heightWidth, heightWidth, foreground.getConfig()); > + final Canvas canvas = new Canvas(output); > + canvas.drawColor(backgroundColor); > + > + // And we draw the icon in the middle of that square: > + final int heightDelta = heightWidth - foreground.getHeight(); > + final int widthDelta = heightWidth - foreground.getWidth(); > + canvas.drawBitmap(foreground, widthDelta / 2, heightDelta / 2, null); We could avoid creating a bitmap that is larger than request.getTargetSize() so that we do not have to downsize it later again. ::: mobile/android/base/java/org/mozilla/gecko/icons/preparation/SuggestedSitePreparer.java:19 (Diff revision 1) > +import org.mozilla.gecko.icons.loader.SuggestedSiteLoader; > + > +import java.util.HashSet; > +import java.util.Set; > + > +public class SuggestedSitePreparer implements Preparer { Can we add unit tests? ::: mobile/android/base/java/org/mozilla/gecko/icons/preparation/SuggestedSitePreparer.java:21 (Diff revision 1) > +import java.util.HashSet; > +import java.util.Set; > + > +public class SuggestedSitePreparer implements Preparer { > + > + boolean initialised = false; I wonder if our guidelines mention US english vs. British english. :) ::: mobile/android/base/java/org/mozilla/gecko/icons/preparation/SuggestedSitePreparer.java:21 (Diff revision 1) > + boolean initialised = false; > + final Set<String> siteFaviconMap = new HashSet<>(); private? ::: mobile/android/base/java/org/mozilla/gecko/icons/preparation/SuggestedSitePreparer.java:43 (Diff revision 1) > + cursor.close(); > + } > + } > + > + @Override > + public void prepare(final IconRequest request) { This should exit early if request.shouldSkipDisk() returns true. ::: mobile/android/base/java/org/mozilla/gecko/icons/preparation/SuggestedSitePreparer.java:54 (Diff revision 1) > + > + final String siteURL = request.getPageUrl(); > + > + if (siteFaviconMap.contains(siteURL)) { > + request.modify() > + .icon(IconDescriptor.createGenericIcon(SuggestedSiteLoader.SUGGESTED_SITE_TOUCHTILE + request.getPageUrl())) Instead of using "generic" I think we should give this its own type so that we can rank it against the other available icons. I feel like we should start with giving it a high value (15?).
Attachment #8833164 - Flags: review?(s.kaspari) → review+
Attachment #8835277 - Flags: review?(s.kaspari) → review+
Pushed by ahunt@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/04d7cacd46f9 Pre: move favicon colour fading to color generator r=sebastian https://hg.mozilla.org/integration/autoland/rev/aeab7252c116 Use bundled touch-tiles as favicons for suggested sites r=sebastian https://hg.mozilla.org/integration/autoland/rev/0cfcc10ad05c Add tests for SuggestedSiteLoader/Preparer r=sebastian
Tested on latest Nightly build 54.0a1 (2017-02-20) using: - Asus ZenPad 8 (Android 6.0.1); - Oneplus Two (Android 6.0.1). The new tile icons for the default websites in Top sites area are looking good, as in the following screenshot: http://imgur.com/a/gu2bN I'm marking this as Verified.
Status: RESOLVED → VERIFIED
Depends on: 1341527
Depends on: 1340957
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: