Bug 999853 - Never pass an empty image path to Picasso. r=lucasr

This commit is contained in:
Margaret Leibovic 2014-04-24 10:43:37 -07:00
parent 84acaaf0a6
commit 1fbab8a4d9
2 changed files with 11 additions and 8 deletions

View File

@ -29,10 +29,15 @@ class PanelBackItemView extends LinearLayout {
title = (TextView) findViewById(R.id.title);
final ImageView image = (ImageView) findViewById(R.id.image);
Picasso.with(getContext())
.load(backImageUrl)
.placeholder(R.drawable.folder_up)
.into(image);
if (TextUtils.isEmpty(backImageUrl)) {
image.setImageResource(R.drawable.folder_up);
} else {
Picasso.with(getContext())
.load(backImageUrl)
.placeholder(R.drawable.folder_up)
.into(image);
}
}
public void updateFromFilter(FilterDetail filter) {

View File

@ -437,10 +437,8 @@ abstract class PanelLayout extends FrameLayout {
final String imageUrl = (emptyViewConfig == null) ? null : emptyViewConfig.getImageUrl();
final ImageView imageView = (ImageView) view.findViewById(R.id.home_empty_image);
if (imageUrl == null) {
Picasso.with(getContext())
.load(R.drawable.icon_home_empty_firefox)
.into(imageView);
if (TextUtils.isEmpty(imageUrl)) {
imageView.setImageResource(R.drawable.icon_home_empty_firefox);
} else {
Picasso.with(getContext())
.load(imageUrl)