Closed Bug 997780 Opened 10 years ago Closed 10 years ago

Implement image loading for suggested sites in TopSitesPanel/TopSitesGridItemView

Categories

(Firefox for Android Graveyard :: Awesomescreen, defect)

All
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 32

People

(Reporter: lucasr, Assigned: lucasr)

References

Details

Attachments

(1 file)

It uses an imageUrl/bgColor pair to define the image, which is different than the other top sites.
Depends on: 997782
Comment on attachment 8408407 [details] [diff] [review]
Load suggested sites images in TopSitesGridItemView (r=wesj)

The image loading logic in TopSitesPanel is overly complex right now. TopSitesGridItemView needs some love in this area. I decided to not cross this bridge just yet but filed bug 997774 to track this work.
Attachment #8408407 - Flags: review?(wjohnston)
Comment on attachment 8408407 [details] [diff] [review]
Load suggested sites images in TopSitesGridItemView (r=wesj)

Review of attachment 8408407 [details] [diff] [review]:
-----------------------------------------------------------------

::: mobile/android/base/home/TopSitesGridItemView.java
@@ +246,5 @@
> +
> +        Picasso.with(getContext())
> +               .load(imageUrl)
> +               .noFade()
> +               .error(R.drawable.favicon)

Someday it might be nice to patch Picasso to take a Picasso.Listener here instead.

::: mobile/android/base/home/TopSitesPanel.java
@@ +546,5 @@
>                  debug("bindView called twice for same values; short-circuiting.");
>                  return;
>              }
>  
> +            if (type == TopSites.TYPE_SUGGESTED) {

TBH, I think I'd rather we keyed this off the presence of an imageUrl than off the rowType.
Attachment #8408407 - Flags: review?(wjohnston) → review+
(In reply to Wesley Johnston (:wesj) from comment #3)
> Comment on attachment 8408407 [details] [diff] [review]
> Load suggested sites images in TopSitesGridItemView (r=wesj)
> 
> Review of attachment 8408407 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: mobile/android/base/home/TopSitesGridItemView.java
> @@ +246,5 @@
> > +
> > +        Picasso.with(getContext())
> > +               .load(imageUrl)
> > +               .noFade()
> > +               .error(R.drawable.favicon)
> 
> Someday it might be nice to patch Picasso to take a Picasso.Listener here
> instead.

What kind of use case do you have in mind?

> ::: mobile/android/base/home/TopSitesPanel.java
> @@ +546,5 @@
> >                  debug("bindView called twice for same values; short-circuiting.");
> >                  return;
> >              }
> >  
> > +            if (type == TopSites.TYPE_SUGGESTED) {
> 
> TBH, I think I'd rather we keyed this off the presence of an imageUrl than
> off the rowType.

Good point, done.
Blocks: 1007645
https://hg.mozilla.org/mozilla-central/rev/af434ea88280
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 32
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: