aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/network
diff options
context:
space:
mode:
authorbananeweizen <bananeweizen@gmx.de>2011-11-26 08:52:05 +0100
committerbananeweizen <bananeweizen@gmx.de>2011-11-26 08:52:05 +0100
commitd90d58c0f0602764266669163e551528aa63f709 (patch)
tree58004f308166ab54af69ff9c6ebb9d270caac50a /main/src/cgeo/geocaching/network
parentb2bfc8383ea5fc39541b5bd1b0bd798bf7dd8e76 (diff)
downloadcgeo-d90d58c0f0602764266669163e551528aa63f709.zip
cgeo-d90d58c0f0602764266669163e551528aa63f709.tar.gz
cgeo-d90d58c0f0602764266669163e551528aa63f709.tar.bz2
fix: use 1x1 transparent image instead of undefined image for counter
banners (avoids small blue/violet square in description)
Diffstat (limited to 'main/src/cgeo/geocaching/network')
-rw-r--r--main/src/cgeo/geocaching/network/HtmlImage.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/main/src/cgeo/geocaching/network/HtmlImage.java b/main/src/cgeo/geocaching/network/HtmlImage.java
index 6c869c2..ca9aa05 100644
--- a/main/src/cgeo/geocaching/network/HtmlImage.java
+++ b/main/src/cgeo/geocaching/network/HtmlImage.java
@@ -70,7 +70,7 @@ public class HtmlImage implements Html.ImageGetter {
public BitmapDrawable getDrawable(final String url) {
// Reject empty and counter images URL
if (StringUtils.isBlank(url) || isCounter(url)) {
- return null;
+ return new BitmapDrawable(getTransparent1x1Image());
}
Bitmap imagePre = null;
@@ -116,7 +116,7 @@ public class HtmlImage implements Html.ImageGetter {
if (returnErrorImage) {
imagePre = BitmapFactory.decodeResource(context.getResources(), R.drawable.image_not_loaded);
} else {
- imagePre = BitmapFactory.decodeResource(context.getResources(), R.drawable.image_no_placement);
+ imagePre = getTransparent1x1Image();
}
}
@@ -148,6 +148,10 @@ public class HtmlImage implements Html.ImageGetter {
return image;
}
+ private Bitmap getTransparent1x1Image() {
+ return BitmapFactory.decodeResource(context.getResources(), R.drawable.image_no_placement);
+ }
+
private Bitmap loadImageFromStorage(final String url) {
try {
final File file = LocalStorage.getStorageFile(geocode, url, true, false);