From 900083e185570cb6d458698bfec1604d5bbef96b Mon Sep 17 00:00:00 2001 From: SimonHalvdansson <49042625+SimonHalvdansson@users.noreply.github.com> Date: Wed, 4 Oct 2023 13:13:56 +0200 Subject: [PATCH] Remove /80 from faviconkit api --- .../harmonichackernews/CommentsRecyclerViewAdapter.java | 2 +- .../simon/harmonichackernews/StoryRecyclerViewAdapter.java | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/simon/harmonichackernews/CommentsRecyclerViewAdapter.java b/app/src/main/java/com/simon/harmonichackernews/CommentsRecyclerViewAdapter.java index e3f7c0a7..dbc0cb78 100644 --- a/app/src/main/java/com/simon/harmonichackernews/CommentsRecyclerViewAdapter.java +++ b/app/src/main/java/com/simon/harmonichackernews/CommentsRecyclerViewAdapter.java @@ -267,7 +267,7 @@ public void onClick(View view) { if (showThumbnail && !TextUtils.isEmpty(story.url)) { try { Picasso.get() - .load("https://api.faviconkit.com/" + Utils.getDomainName(story.url) + "/80") + .load("https://api.faviconkit.com/" + Utils.getDomainName(story.url) + "") .resize(80, 80) .onlyScaleDown() .placeholder(Objects.requireNonNull(ContextCompat.getDrawable(ctx, R.drawable.ic_action_web))) diff --git a/app/src/main/java/com/simon/harmonichackernews/StoryRecyclerViewAdapter.java b/app/src/main/java/com/simon/harmonichackernews/StoryRecyclerViewAdapter.java index 219d07ff..c87c2202 100644 --- a/app/src/main/java/com/simon/harmonichackernews/StoryRecyclerViewAdapter.java +++ b/app/src/main/java/com/simon/harmonichackernews/StoryRecyclerViewAdapter.java @@ -41,6 +41,7 @@ import org.sufficientlysecure.htmltextview.OnClickATagListener; import java.lang.reflect.Array; +import java.net.URL; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -181,13 +182,14 @@ public void onBindViewHolder(@NotNull final RecyclerView.ViewHolder holder, int //Picasso sometimes loses its context, that should just be ignored try { Picasso.get() - .load("https://api.faviconkit.com/" + url + "/80") + //.load("https://www.google.com/s2/favicons?domain="+ url + "&sz=80") + .load("https://api.faviconkit.com/" + url + "") + //.load("https://icons.duckduckgo.com/ip3/" + url + ".ico") .resize(80, 80) .onlyScaleDown() .placeholder(Objects.requireNonNull(ContextCompat.getDrawable(ctx, R.drawable.ic_action_web))) .into(storyViewHolder.metaFavicon); } catch (Exception ignored){}; - } storyViewHolder.commentsIcon.setImageResource(hotness > 0 && storyViewHolder.story.score + storyViewHolder.story.descendants > hotness ? R.drawable.ic_action_whatshot : R.drawable.ic_action_comment);