aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/utils/ImageUtils.java
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2015-03-08 22:34:24 +0100
committerSamuel Tardieu <sam@rfc1149.net>2015-03-08 22:34:24 +0100
commitb451e9a06f3f5ee7f1b6914031413f9c2b0b6432 (patch)
treeca2a477144990780ad5ad2ebe524240f67002649 /main/src/cgeo/geocaching/utils/ImageUtils.java
parentb6140ee20f1a74c580208c3f513954a13b7aa572 (diff)
parentf44a56394254731f63eb279073f2949b09966aa1 (diff)
downloadcgeo-b451e9a06f3f5ee7f1b6914031413f9c2b0b6432.zip
cgeo-b451e9a06f3f5ee7f1b6914031413f9c2b0b6432.tar.gz
cgeo-b451e9a06f3f5ee7f1b6914031413f9c2b0b6432.tar.bz2
Merge branch 'issue-4727' into upstream
Diffstat (limited to 'main/src/cgeo/geocaching/utils/ImageUtils.java')
-rw-r--r--main/src/cgeo/geocaching/utils/ImageUtils.java27
1 files changed, 14 insertions, 13 deletions
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<Image> images, final String htmlText, final String geocode) {
+ public static void addImagesFromHtml(final Collection<Image> images, final String geocode, final String... htmlText) {
final Set<String> 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);
+ }
}
/**