aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/utils/ImageUtils.java
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2014-11-28 14:31:27 +0100
committerSamuel Tardieu <sam@rfc1149.net>2014-11-28 14:31:27 +0100
commita868fb3eebb96bff659fdaba01b6b5a54bfbd9a9 (patch)
treea459d56c7069cd375f397dfb7282ba350ca9efd2 /main/src/cgeo/geocaching/utils/ImageUtils.java
parentb181ef02fa057df18f0d071acbd628806d130591 (diff)
downloadcgeo-a868fb3eebb96bff659fdaba01b6b5a54bfbd9a9.zip
cgeo-a868fb3eebb96bff659fdaba01b6b5a54bfbd9a9.tar.gz
cgeo-a868fb3eebb96bff659fdaba01b6b5a54bfbd9a9.tar.bz2
Revert "fix #4481: cache rendering leads to ANR"
This reverts commit b181ef02fa057df18f0d071acbd628806d130591. Some caches will not cope with partial redraws, such as http://coord.info/GC53417.
Diffstat (limited to 'main/src/cgeo/geocaching/utils/ImageUtils.java')
-rw-r--r--main/src/cgeo/geocaching/utils/ImageUtils.java9
1 files changed, 2 insertions, 7 deletions
diff --git a/main/src/cgeo/geocaching/utils/ImageUtils.java b/main/src/cgeo/geocaching/utils/ImageUtils.java
index 15d2da1..e2ae7f5 100644
--- a/main/src/cgeo/geocaching/utils/ImageUtils.java
+++ b/main/src/cgeo/geocaching/utils/ImageUtils.java
@@ -348,6 +348,7 @@ public final class ImageUtils {
@SuppressWarnings("deprecation")
public ContainerDrawable(@NonNull final TextView view, final Observable<? extends Drawable> drawableObservable) {
this.view = view;
+ drawable = null;
setBounds(0, 0, 0, 0);
updateFrom(drawableObservable);
}
@@ -363,13 +364,7 @@ public final class ImageUtils {
public void call(final Drawable newDrawable) {
setBounds(0, 0, newDrawable.getIntrinsicWidth(), newDrawable.getIntrinsicHeight());
drawable = newDrawable;
- view.invalidateDrawable(this);
- // This is necessary to force a layout recomputation. Appending text takes much less time
- // than setting the whole text. However, if many images are drawn one after the other without
- // line breaks or text between them, the rendering might be incorrect as is the case in
- // for http://coord.info/GC49CQC.
- // TODO: find a better way to make the view get redrawn, or use a different kind of view
- view.append("");
+ view.setText(view.getText());
}
public final void updateFrom(final Observable<? extends Drawable> drawableObservable) {