mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 931843 - Part 3: don't retain thumbnails. r=bnicholson
This commit is contained in:
parent
55808f7a19
commit
b6c58c1c02
@ -43,7 +43,7 @@ public class TopSitesGridItemView extends RelativeLayout {
|
||||
private String mUrl;
|
||||
private String mFaviconURL;
|
||||
|
||||
private Bitmap mThumbnail;
|
||||
private boolean mThumbnailSet;
|
||||
|
||||
// Pinned state.
|
||||
private boolean mIsPinned = false;
|
||||
@ -170,7 +170,7 @@ public class TopSitesGridItemView extends RelativeLayout {
|
||||
} else if (changed) {
|
||||
// Because we'll have a new favicon or thumbnail arriving shortly, and
|
||||
// we need to not reject it because we already had a thumbnail.
|
||||
mThumbnail = null;
|
||||
mThumbnailSet = false;
|
||||
}
|
||||
|
||||
if (changed) {
|
||||
@ -196,6 +196,7 @@ public class TopSitesGridItemView extends RelativeLayout {
|
||||
mThumbnailView.setScaleType(SCALE_TYPE_RESOURCE);
|
||||
mThumbnailView.setImageResource(resId);
|
||||
mThumbnailView.setBackgroundColor(0x0);
|
||||
mThumbnailSet = false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -209,7 +210,7 @@ public class TopSitesGridItemView extends RelativeLayout {
|
||||
displayThumbnail(R.drawable.favicon);
|
||||
return;
|
||||
}
|
||||
mThumbnail = thumbnail;
|
||||
mThumbnailSet = true;
|
||||
Favicons.cancelFaviconLoad(mLoadId);
|
||||
|
||||
mThumbnailView.setScaleType(SCALE_TYPE_THUMBNAIL);
|
||||
@ -234,7 +235,7 @@ public class TopSitesGridItemView extends RelativeLayout {
|
||||
* @param favicon The favicon to show as thumbnail.
|
||||
*/
|
||||
public void displayFavicon(Bitmap favicon, String faviconURL) {
|
||||
if (mThumbnail != null) {
|
||||
if (mThumbnailSet) {
|
||||
// Already showing a thumbnail; do nothing.
|
||||
return;
|
||||
}
|
||||
|
@ -141,14 +141,6 @@ public class TwoLinePageRow extends LinearLayout
|
||||
mUrl.setCompoundDrawablesWithIntrinsicBounds(mUrlIconId, 0, mBookmarkIconId, 0);
|
||||
}
|
||||
|
||||
private void setFaviconWithUrl(Bitmap favicon, String url) {
|
||||
if (favicon == null) {
|
||||
mFavicon.showDefaultFavicon();
|
||||
} else {
|
||||
mFavicon.updateImage(favicon, url);
|
||||
}
|
||||
}
|
||||
|
||||
private void setBookmarkIcon(int bookmarkIconId) {
|
||||
if (mBookmarkIconId == bookmarkIconId) {
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user