Skip to content

Commit

Permalink
Update context on bind
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik Henter <[email protected]>

Signed-off-by: Dominik Henter <[email protected]>
  • Loading branch information
DoHe committed Mar 30, 2024
1 parent 81adf4c commit 7041044
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ public void bind(@NonNull RssItem rssItem) {


ImageView imgViewFavIcon = getImageViewFavIcon();
favIconHandler.setContext(itemView.getContext());
if (imgViewFavIcon != null) {
favIconHandler.loadFavIconForFeed(favIconUrl, imgViewFavIcon, Math.round((marginFavIcon - sizeOfFavIcon) / 2f));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
public class FavIconHandler {
private static final String TAG = FavIconHandler.class.getCanonicalName();

private final RequestManager mGlide;
private final Context mContext;
private RequestManager mGlide;
private Context mContext;
private final int mPlaceHolder;

public FavIconHandler(Context context) {
Expand Down Expand Up @@ -155,4 +155,9 @@ private void UpdateAvgColorOfFeed(long feedId, Bitmap bitmap, Context context) {
Log.v(TAG, "Failed to update AVG color of feed: " + feedId);
}
}

public void setContext(Context context) {
mContext = context;
mGlide = Glide.with(context);
}
}

0 comments on commit 7041044

Please sign in to comment.