| Index: chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticleViewHolder.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticleViewHolder.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticleViewHolder.java
|
| index 11e61a3ffcca9aeb17cfc7c261c74546ef125b9a..564b0e238d26c46b25ec560e2015080fe845416a 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticleViewHolder.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticleViewHolder.java
|
| @@ -199,10 +199,13 @@ public void onBindViewHolder(SnippetArticle article, SuggestionsCategoryInfo cat
|
| setThumbnail();
|
|
|
| // Set the favicon of the publisher.
|
| + // We start initialising with the default favicon to reserve the space and prevent the text
|
| + // from moving later.
|
| + setDefaultFaviconOnView();
|
| try {
|
| fetchFaviconFromLocalCache(new URI(mArticle.mUrl), true);
|
| } catch (URISyntaxException e) {
|
| - setDefaultFaviconOnView();
|
| + // Do nothing, stick to the default favicon.
|
| }
|
|
|
| mOfflineBadge.setVisibility(View.GONE);
|
| @@ -396,11 +399,12 @@ private void fetchFaviconFromLocalCache(final URI snippetUri, final boolean fall
|
| getSnippetDomain(snippetUri), mPublisherFaviconSizePx, new FaviconImageCallback() {
|
| @Override
|
| public void onFaviconAvailable(Bitmap image, String iconUrl) {
|
| - if (image == null && fallbackToService) {
|
| + if (image != null) {
|
| + setFaviconOnView(image);
|
| + } else if (fallbackToService) {
|
| fetchFaviconFromService(snippetUri);
|
| - return;
|
| }
|
| - setFaviconOnView(image);
|
| + // Else do nothing, we already have the placeholder set.
|
| }
|
| });
|
| }
|
| @@ -408,9 +412,6 @@ public void onFaviconAvailable(Bitmap image, String iconUrl) {
|
| // TODO(crbug.com/635567): Fix this properly.
|
| @SuppressLint("DefaultLocale")
|
| private void fetchFaviconFromService(final URI snippetUri) {
|
| - // Show the default favicon immediately.
|
| - setDefaultFaviconOnView();
|
| -
|
| if (!mUseFaviconService) return;
|
| int sizePx = getFaviconServiceSupportedSize();
|
| if (sizePx == 0) return;
|
|
|