From f44a56394254731f63eb279073f2949b09966aa1 Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Sun, 8 Mar 2015 22:33:17 +0100 Subject: fix #4727: images in short description are absent from images tab --- main/src/cgeo/geocaching/utils/ImageUtils.java | 27 +++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'main/src/cgeo/geocaching/utils/ImageUtils.java') diff --git a/main/src/cgeo/geocaching/utils/ImageUtils.java b/main/src/cgeo/geocaching/utils/ImageUtils.java index 9011ab9..71d5e39 100644 --- a/main/src/cgeo/geocaching/utils/ImageUtils.java +++ b/main/src/cgeo/geocaching/utils/ImageUtils.java @@ -320,26 +320,27 @@ public final class ImageUtils { /** * Add images present in the HTML description to the existing collection. - * - * @param images a collection of images - * @param htmlText the HTML description to be parsed + * @param images a collection of images * @param geocode the common title for images in the description + * @param htmlText the HTML description to be parsed, can be repeated */ - public static void addImagesFromHtml(final Collection images, final String htmlText, final String geocode) { + public static void addImagesFromHtml(final Collection images, final String geocode, final String... htmlText) { final Set urls = new LinkedHashSet<>(); for (final Image image : images) { urls.add(image.getUrl()); } - Html.fromHtml(StringUtils.defaultString(htmlText), new ImageGetter() { - @Override - public Drawable getDrawable(final String source) { - if (!urls.contains(source) && canBeOpenedExternally(source)) { - images.add(new Image(source, StringUtils.defaultString(geocode))); - urls.add(source); + for (final String text: htmlText) { + Html.fromHtml(StringUtils.defaultString(text), new ImageGetter() { + @Override + public Drawable getDrawable(final String source) { + if (!urls.contains(source) && canBeOpenedExternally(source)) { + images.add(new Image(source, StringUtils.defaultString(geocode))); + urls.add(source); + } + return null; } - return null; - } - }, null); + }, null); + } } /** -- cgit v1.1