зеркало из https://github.com/mozilla/gecko-dev.git
Bug 931843 - Part 3: don't retain thumbnails. r=bnicholson
This commit is contained in:
Родитель
6983a6c01c
Коммит
2dae3effaa
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче