borrow AsyncTask stuff from libgdx

- for html backend async tasks are just put on Queue and run on next main-loop iteration
This commit is contained in:
Hannes Janetzek
2013-07-26 23:35:05 +02:00
parent 8787ac7b48
commit 5b16f6b085
11 changed files with 422 additions and 26 deletions

View File

@@ -28,6 +28,7 @@ import org.oscim.view.MapView;
import android.content.Context;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.view.View;
import android.widget.RelativeLayout;
/**
@@ -138,7 +139,7 @@ public class AndroidMapView extends RelativeLayout {
if (!mWaitRedraw) {
mWaitRedraw = true;
post(mRedrawRequest);
getView().post(mRedrawRequest);
}
}
@@ -165,8 +166,13 @@ public class AndroidMapView extends RelativeLayout {
}
@Override
public boolean postRunnable(Runnable runnable) {
return post(runnable);
public boolean post(Runnable runnable) {
return getView().post(runnable);
}
@Override
public boolean postDelayed(Runnable action, long delay) {
return getView().postDelayed(action, delay);
}
};
@@ -185,6 +191,9 @@ public class AndroidMapView extends RelativeLayout {
mMapView.updateMap(false);
}
View getView(){
return this;
}
public MapView getMap() {
return mMapView;