Update bitmap cache
This commit is contained in:
parent
5773a4ca13
commit
a0e52f355f
1 changed files with 6 additions and 0 deletions
|
@ -41,9 +41,11 @@ public class AsyncLoadingThread extends Thread {
|
||||||
while (true) {
|
while (true) {
|
||||||
try {
|
try {
|
||||||
updateBitmapTilesCache();
|
updateBitmapTilesCache();
|
||||||
|
int cacheCounter = 0;
|
||||||
boolean tileLoaded = false;
|
boolean tileLoaded = false;
|
||||||
boolean mapLoaded = false;
|
boolean mapLoaded = false;
|
||||||
while (!requests.isEmpty()) {
|
while (!requests.isEmpty()) {
|
||||||
|
cacheCounter++;
|
||||||
Object req = requests.pop();
|
Object req = requests.pop();
|
||||||
if (req instanceof TileLoadDownloadRequest) {
|
if (req instanceof TileLoadDownloadRequest) {
|
||||||
TileLoadDownloadRequest r = (TileLoadDownloadRequest) req;
|
TileLoadDownloadRequest r = (TileLoadDownloadRequest) req;
|
||||||
|
@ -58,6 +60,10 @@ public class AsyncLoadingThread extends Thread {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (cacheCounter == 10) {
|
||||||
|
cacheCounter = 0;
|
||||||
|
updateBitmapTilesCache();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (tileLoaded || mapLoaded) {
|
if (tileLoaded || mapLoaded) {
|
||||||
// use downloader callback
|
// use downloader callback
|
||||||
|
|
Loading…
Reference in a new issue