aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2015-09-26 11:00:53 +0200
committerSamuel Tardieu <sam@rfc1149.net>2015-09-26 11:00:53 +0200
commit70d4a7c38f793041a14da1e485f83d530b4a7add (patch)
tree16d86e92ad436142073d9fb48310d8e8b6ef5051
parent38786260678f89b4c3e92fee6f2477a88098caa3 (diff)
downloadcgeo-70d4a7c38f793041a14da1e485f83d530b4a7add.zip
cgeo-70d4a7c38f793041a14da1e485f83d530b4a7add.tar.gz
cgeo-70d4a7c38f793041a14da1e485f83d530b4a7add.tar.bz2
Add comments in code
-rw-r--r--main/src/cgeo/geocaching/utils/ImageUtils.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/main/src/cgeo/geocaching/utils/ImageUtils.java b/main/src/cgeo/geocaching/utils/ImageUtils.java
index 9fcd657..3879a14 100644
--- a/main/src/cgeo/geocaching/utils/ImageUtils.java
+++ b/main/src/cgeo/geocaching/utils/ImageUtils.java
@@ -11,6 +11,12 @@ import org.apache.commons.lang3.tuple.ImmutablePair;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
+import rx.Observable;
+import rx.Scheduler.Worker;
+import rx.android.schedulers.AndroidSchedulers;
+import rx.functions.Action0;
+import rx.functions.Action1;
+
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
@@ -47,12 +53,6 @@ import java.util.Locale;
import java.util.Set;
import java.util.concurrent.LinkedBlockingQueue;
-import rx.Observable;
-import rx.Scheduler.Worker;
-import rx.android.schedulers.AndroidSchedulers;
-import rx.functions.Action0;
-import rx.functions.Action1;
-
public final class ImageUtils {
private static final int[] ORIENTATIONS = {
ExifInterface.ORIENTATION_ROTATE_90,
@@ -363,7 +363,7 @@ public final class ImageUtils {
public static class ContainerDrawable extends BitmapDrawable implements Action1<Drawable> {
final private static Object lock = new Object(); // Used to lock the queue to determine if a refresh needs to be scheduled
final private static LinkedBlockingQueue<ImmutablePair<ContainerDrawable, Drawable>> REDRAW_QUEUE = new LinkedBlockingQueue<>();
- final private static Set<TextView> VIEWS = new HashSet<>(); // Modified only on the UI thread
+ final private static Set<TextView> VIEWS = new HashSet<>(); // Modified only on the UI thread, from redrawQueuedDrawables
final private static Worker UI_WORKER = AndroidSchedulers.mainThread().createWorker();
final private static Action0 REDRAW_QUEUED_DRAWABLES = new Action0() {
@Override
@@ -431,6 +431,7 @@ public final class ImageUtils {
}
}
for (final TextView view : VIEWS) {
+ // This forces the relayout of the text around the updated images.
view.setText(view.getText());
}
VIEWS.clear();