Search in sources :

Example 1 with ThumbnailCache

use of dev.dworks.apps.anexplorer.misc.ThumbnailCache in project AnExplorer by 1hakr.

the class DocumentsApplication method getThumbnailsCache.

public static ThumbnailCache getThumbnailsCache(Context context, Point size) {
    final DocumentsApplication app = (DocumentsApplication) context.getApplicationContext();
    final ThumbnailCache thumbnails = app.mThumbnails;
    if (!size.equals(app.mThumbnailsSize)) {
        thumbnails.evictAll();
        app.mThumbnailsSize = size;
    }
    return thumbnails;
}
Also used : ThumbnailCache(dev.dworks.apps.anexplorer.misc.ThumbnailCache)

Example 2 with ThumbnailCache

use of dev.dworks.apps.anexplorer.misc.ThumbnailCache in project AnExplorer by 1hakr.

the class DocumentsApplication method onCreate.

@Override
public void onCreate() {
    super.onCreate();
    if (!BuildConfig.DEBUG) {
        AnalyticsManager.intialize(getApplicationContext());
    }
    sInstance = this;
    final ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
    final int memoryClassBytes = am.getMemoryClass() * 1024 * 1024;
    mRoots = new RootsCache(this);
    mRoots.updateAsync();
    mSAFManager = new SAFManager(this);
    mThumbnails = new ThumbnailCache(memoryClassBytes / 4);
    final IntentFilter packageFilter = new IntentFilter();
    packageFilter.addAction(Intent.ACTION_PACKAGE_ADDED);
    packageFilter.addAction(Intent.ACTION_PACKAGE_CHANGED);
    packageFilter.addAction(Intent.ACTION_PACKAGE_REMOVED);
    packageFilter.addAction(Intent.ACTION_PACKAGE_DATA_CLEARED);
    packageFilter.addDataScheme("package");
    registerReceiver(mCacheReceiver, packageFilter);
    final IntentFilter localeFilter = new IntentFilter();
    localeFilter.addAction(Intent.ACTION_LOCALE_CHANGED);
    registerReceiver(mCacheReceiver, localeFilter);
    isTelevision = Utils.isTelevision(this);
}
Also used : IntentFilter(android.content.IntentFilter) RootsCache(dev.dworks.apps.anexplorer.misc.RootsCache) SAFManager(dev.dworks.apps.anexplorer.misc.SAFManager) ThumbnailCache(dev.dworks.apps.anexplorer.misc.ThumbnailCache) ActivityManager(android.app.ActivityManager) Point(android.graphics.Point)

Aggregations

ThumbnailCache (dev.dworks.apps.anexplorer.misc.ThumbnailCache)2 ActivityManager (android.app.ActivityManager)1 IntentFilter (android.content.IntentFilter)1 Point (android.graphics.Point)1 RootsCache (dev.dworks.apps.anexplorer.misc.RootsCache)1 SAFManager (dev.dworks.apps.anexplorer.misc.SAFManager)1