Update bitmap cache

This commit is contained in:
Vitaliy 2021-04-12 19:10:02 +03:00
parent 5773a4ca13
commit a0e52f355f

View file

@ -41,9 +41,11 @@ public class AsyncLoadingThread extends Thread {
while (true) {
try {
updateBitmapTilesCache();
int cacheCounter = 0;
boolean tileLoaded = false;
boolean mapLoaded = false;
while (!requests.isEmpty()) {
cacheCounter++;
Object req = requests.pop();
if (req instanceof TileLoadDownloadRequest) {
TileLoadDownloadRequest r = (TileLoadDownloadRequest) req;
@ -58,6 +60,10 @@ public class AsyncLoadingThread extends Thread {
}
}
}
if (cacheCounter == 10) {
cacheCounter = 0;
updateBitmapTilesCache();
}
}
if (tileLoaded || mapLoaded) {
// use downloader callback