Final touch-ups to improved image loading.

This commit is contained in:
Dmitry Brant 2017-05-19 17:19:10 +02:00
parent 7a4062a377
commit 38e7cad345
9 changed files with 44 additions and 33 deletions

View file

@ -11,6 +11,7 @@ import android.content.pm.PackageManager;
import android.os.Build;
import android.database.sqlite.SQLiteDatabase;
import android.preference.PreferenceManager;
import android.support.v4.util.LruCache;
import com.facebook.drawee.backends.pipeline.Fresco;
import com.facebook.stetho.Stetho;
@ -84,6 +85,7 @@ public class CommonsApplication extends Application {
private static CommonsApplication instance = null;
private AbstractHttpClient httpClient = null;
private MWApi api = null;
LruCache<String, String> thumbnailUrlCache = new LruCache<>(1024);
private CacheController cacheData = null;
private DBOpenHelper dbOpenHelper = null;
private NearbyPlaces nearbyPlaces = null;
@ -139,6 +141,10 @@ public class CommonsApplication extends Application {
return cacheData;
}
public LruCache<String, String> getThumbnailUrlCache() {
return thumbnailUrlCache;
}
public synchronized DBOpenHelper getDBOpenHelper() {
if (dbOpenHelper == null) {
dbOpenHelper = new DBOpenHelper(this);