Bug 905685 - Clear favicon until the new image finishes loading in TwoLinePageRow (r=sriram)

This commit is contained in:
Lucas Rocha 2013-09-18 12:58:58 -04:00
parent 63ca8c5534
commit 59c9b9f42e
2 changed files with 11 additions and 0 deletions

View File

@ -197,6 +197,9 @@ public class TwoLinePageRow extends LinearLayout
if (favicon != null) {
setFaviconWithUrl(favicon, url);
} else {
// Show blank image until the new favicon finishes loading
mFavicon.clearImage();
mLoadFaviconTask = new LoadFaviconTask(url);
// Try to use a thread pool instead of serial execution of tasks

View File

@ -154,6 +154,14 @@ public class FaviconView extends ImageView {
formatImage();
}
/**
* Clear image and background shown by this view.
*/
public void clearImage() {
setImageResource(0);
hideBackground();
}
/**
* Update the displayed image and apply the scaling logic.
* The scaling logic will attempt to resize the image to fit correctly inside the view in a way