Java 类com.bumptech.glide.load.engine.cache.MemoryCache 实例源码

项目:GitHub    文件:GlideTest.java   
@Test
public void testTrimMemory() {
  BitmapPool bitmapPool = mock(BitmapPool.class);
  MemoryCache memoryCache = mock(MemoryCache.class);

  Glide glide =
      new GlideBuilder().setBitmapPool(bitmapPool).setMemoryCache(memoryCache)
          .build(getContext());

  final int level = 123;

  glide.trimMemory(level);

  verify(bitmapPool).trimMemory(eq(level));
  verify(memoryCache).trimMemory(eq(level));
}
项目:GitHub    文件:Engine.java   
public Engine(MemoryCache memoryCache,
    DiskCache.Factory diskCacheFactory,
    GlideExecutor diskCacheExecutor,
    GlideExecutor sourceExecutor,
    GlideExecutor sourceUnlimitedExecutor,
    GlideExecutor animationExecutor) {
  this(
      memoryCache,
      diskCacheFactory,
      diskCacheExecutor,
      sourceExecutor,
      sourceUnlimitedExecutor,
      animationExecutor,
      /*jobs=*/ null,
      /*keyFactory=*/ null,
      /*activeResources=*/ null,
      /*engineJobFactory=*/ null,
      /*decodeJobFactory=*/ null,
      /*resourceRecycler=*/ null);
}
项目:DebugDrawer    文件:GlideModule.java   
public GlideModule(@NonNull Glide glide) {
    if (!HAS_GLIDE) {
        throw new RuntimeException("Glide dependency is not found");
    }

    this.glide = glide;

    try {
        final Class<?> glideClass = glide.getClass();
        final Field field = glideClass.getDeclaredField("memoryCache");
        field.setAccessible(true);
        this.memoryCache = (MemoryCache) field.get(glide);
    } catch (Throwable t) {
        throw new RuntimeException("Incompatible Glide version", t);
    }
}
项目:GitHub    文件:BitmapPreFillRunner.java   
BitmapPreFillRunner(BitmapPool bitmapPool, MemoryCache memoryCache, PreFillQueue allocationOrder,
    Clock clock, Handler handler) {
  this.bitmapPool = bitmapPool;
  this.memoryCache = memoryCache;
  this.toPrefill = allocationOrder;
  this.clock = clock;
  this.handler = handler;
}
项目:GitHub    文件:Engine.java   
public Engine(MemoryCache memoryCache,
    DiskCache.Factory diskCacheFactory,
    GlideExecutor diskCacheExecutor,
    GlideExecutor sourceExecutor,
    GlideExecutor sourceUnlimitedExecutor) {
  this(memoryCache, diskCacheFactory, diskCacheExecutor, sourceExecutor, sourceUnlimitedExecutor,
      null, null, null, null, null, null);
}
项目:GitHub    文件:GlideTest.java   
@Test
public void testCanSetMemoryCategory() {
  MemoryCache memoryCache = mock(MemoryCache.class);
  BitmapPool bitmapPool = mock(BitmapPool.class);

  MemoryCategory memoryCategory = MemoryCategory.NORMAL;
  Glide glide =
      new GlideBuilder().setMemoryCache(memoryCache).setBitmapPool(bitmapPool)
          .build(getContext());
  glide.setMemoryCategory(memoryCategory);

  verify(memoryCache).setSizeMultiplier(eq(memoryCategory.getMultiplier()));
  verify(bitmapPool).setSizeMultiplier(eq(memoryCategory.getMultiplier()));
}
项目:GitHub    文件:GlideTest.java   
@Test
public void testClearMemory() {
  BitmapPool bitmapPool = mock(BitmapPool.class);
  MemoryCache memoryCache = mock(MemoryCache.class);

  Glide glide =
      new GlideBuilder().setBitmapPool(bitmapPool).setMemoryCache(memoryCache)
          .build(getContext());

  glide.clearMemory();

  verify(bitmapPool).clearMemory();
  verify(memoryCache).clearMemory();
}
项目:GitHub    文件:GlideTest.java   
@Override
public void applyOptions(Context context, GlideBuilder builder) {
  // Run all tasks on the main thread so they complete synchronously.
  GlideExecutor executor = MockGlideExecutor.newMainThreadExecutor();

  DiskCache.Factory diskCacheFactory = mock(DiskCache.Factory.class);
  when(diskCacheFactory.build()).thenReturn(mock(DiskCache.class));

  builder.setMemoryCache(mock(MemoryCache.class)).setDiskCache(diskCacheFactory)
      .setResizeExecutor(executor).setDiskCacheExecutor(executor);
}
项目:GitHub    文件:BitmapPreFillRunner.java   
@VisibleForTesting
BitmapPreFillRunner(BitmapPool bitmapPool, MemoryCache memoryCache, PreFillQueue allocationOrder,
    Clock clock, Handler handler) {
  this.bitmapPool = bitmapPool;
  this.memoryCache = memoryCache;
  this.toPrefill = allocationOrder;
  this.clock = clock;
  this.handler = handler;
}
项目:saarang-iosched    文件:Glide.java   
Glide(Engine engine, RequestQueue requestQueue, MemoryCache memoryCache, BitmapPool bitmapPool,
        Context context) {
    this.engine = engine;
    this.requestQueue = requestQueue;
    this.bitmapPool = bitmapPool;
    this.memoryCache = memoryCache;

    dataLoadProviderFactory = new DataLoadProviderFactory();
    dataLoadProviderFactory.register(InputStream.class, Bitmap.class, new StreamBitmapDataLoadProvider(bitmapPool));

    dataLoadProviderFactory.register(ParcelFileDescriptor.class, Bitmap.class,
            new FileDescriptorBitmapDataLoadProvider(bitmapPool));

    ImageVideoDataLoadProvider imageVideoDataLoadProvider = new ImageVideoDataLoadProvider(bitmapPool);
    dataLoadProviderFactory.register(ImageVideoWrapper.class, Bitmap.class, imageVideoDataLoadProvider);

    GifDataLoadProvider gifDataLoadProvider = new GifDataLoadProvider(context, bitmapPool);
    dataLoadProviderFactory.register(ImageVideoWrapper.class, GifBitmapWrapper.class,
            new ImageVideoGifDataLoadProvider(imageVideoDataLoadProvider, gifDataLoadProvider));

    register(File.class, ParcelFileDescriptor.class, new FileDescriptorFileLoader.Factory());
    register(File.class, InputStream.class, new StreamFileLoader.Factory());
    register(Integer.class, ParcelFileDescriptor.class, new FileDescriptorResourceLoader.Factory());
    register(Integer.class, InputStream.class, new StreamResourceLoader.Factory());
    register(String.class, ParcelFileDescriptor.class, new FileDescriptorStringLoader.Factory());
    register(String.class, InputStream.class, new StreamStringLoader.Factory());
    register(Uri.class, ParcelFileDescriptor.class, new FileDescriptorUriLoader.Factory());
    register(Uri.class, InputStream.class, new StreamUriLoader.Factory());
    register(URL.class, InputStream.class, new StreamUrlLoader.Factory());
    register(GlideUrl.class, InputStream.class, new VolleyUrlLoader.Factory(requestQueue));

    transcoderFactory.register(Bitmap.class, BitmapDrawable.class,
            new BitmapDrawableTranscoder(context.getResources(), bitmapPool));
    transcoderFactory.register(GifBitmapWrapper.class, Drawable.class,
            new GifBitmapDrawableTranscoder(context));
}
项目:saarang-iosched    文件:EngineJob.java   
public EngineJob(Key key, MemoryCache cache, Handler mainHandler, boolean isCacheable, EngineJobListener listener) {
    this.key = key;
    this.cache = cache;
    this.isCacheable = isCacheable;
    this.listener = listener;
    this.mainHandler = mainHandler;
}
项目:saarang-iosched    文件:Engine.java   
Engine(ResourceRunnerFactory factory, MemoryCache cache, Map<Key, ResourceRunner> runners, KeyFactory keyFactory) {
    this.factory = factory;
    this.cache = cache;
    this.runners = runners;
    this.keyFactory = keyFactory;

    cache.setResourceRemovedListener(this);
}
项目:saarang-iosched    文件:DefaultResourceRunnerFactory.java   
public DefaultResourceRunnerFactory(MemoryCache memoryCache, DiskCache diskCache, Handler mainHandler,
        ExecutorService service, Handler bgHandler ) {
    this.memoryCache = memoryCache;
    this.diskCache = diskCache;
    this.mainHandler = mainHandler;
    this.service = service;
    this.bgHandler = bgHandler;
}
项目:AppDevFestSudeste2015    文件:Glide.java   
Glide(Engine engine, RequestQueue requestQueue, MemoryCache memoryCache, BitmapPool bitmapPool,
        Context context) {
    this.engine = engine;
    this.requestQueue = requestQueue;
    this.bitmapPool = bitmapPool;
    this.memoryCache = memoryCache;

    dataLoadProviderFactory = new DataLoadProviderFactory();
    dataLoadProviderFactory.register(InputStream.class, Bitmap.class, new StreamBitmapDataLoadProvider(bitmapPool));

    dataLoadProviderFactory.register(ParcelFileDescriptor.class, Bitmap.class,
            new FileDescriptorBitmapDataLoadProvider(bitmapPool));

    ImageVideoDataLoadProvider imageVideoDataLoadProvider = new ImageVideoDataLoadProvider(bitmapPool);
    dataLoadProviderFactory.register(ImageVideoWrapper.class, Bitmap.class, imageVideoDataLoadProvider);

    GifDataLoadProvider gifDataLoadProvider = new GifDataLoadProvider(context, bitmapPool);
    dataLoadProviderFactory.register(ImageVideoWrapper.class, GifBitmapWrapper.class,
            new ImageVideoGifDataLoadProvider(imageVideoDataLoadProvider, gifDataLoadProvider));

    register(File.class, ParcelFileDescriptor.class, new FileDescriptorFileLoader.Factory());
    register(File.class, InputStream.class, new StreamFileLoader.Factory());
    register(Integer.class, ParcelFileDescriptor.class, new FileDescriptorResourceLoader.Factory());
    register(Integer.class, InputStream.class, new StreamResourceLoader.Factory());
    register(String.class, ParcelFileDescriptor.class, new FileDescriptorStringLoader.Factory());
    register(String.class, InputStream.class, new StreamStringLoader.Factory());
    register(Uri.class, ParcelFileDescriptor.class, new FileDescriptorUriLoader.Factory());
    register(Uri.class, InputStream.class, new StreamUriLoader.Factory());
    register(URL.class, InputStream.class, new StreamUrlLoader.Factory());
    register(GlideUrl.class, InputStream.class, new VolleyUrlLoader.Factory(requestQueue));

    transcoderFactory.register(Bitmap.class, BitmapDrawable.class,
            new BitmapDrawableTranscoder(context.getResources(), bitmapPool));
    transcoderFactory.register(GifBitmapWrapper.class, Drawable.class,
            new GifBitmapDrawableTranscoder(context));
}
项目:AppDevFestSudeste2015    文件:EngineJob.java   
public EngineJob(Key key, MemoryCache cache, Handler mainHandler, boolean isCacheable, EngineJobListener listener) {
    this.key = key;
    this.cache = cache;
    this.isCacheable = isCacheable;
    this.listener = listener;
    this.mainHandler = mainHandler;
}
项目:AppDevFestSudeste2015    文件:Engine.java   
Engine(ResourceRunnerFactory factory, MemoryCache cache, Map<Key, ResourceRunner> runners, KeyFactory keyFactory) {
    this.factory = factory;
    this.cache = cache;
    this.runners = runners;
    this.keyFactory = keyFactory;

    cache.setResourceRemovedListener(this);
}
项目:AppDevFestSudeste2015    文件:DefaultResourceRunnerFactory.java   
public DefaultResourceRunnerFactory(MemoryCache memoryCache, DiskCache diskCache, Handler mainHandler,
        ExecutorService service, Handler bgHandler ) {
    this.memoryCache = memoryCache;
    this.diskCache = diskCache;
    this.mainHandler = mainHandler;
    this.service = service;
    this.bgHandler = bgHandler;
}
项目:devfestnorte-app    文件:Glide.java   
Glide(Engine engine, RequestQueue requestQueue, MemoryCache memoryCache, BitmapPool bitmapPool,
        Context context) {
    this.engine = engine;
    this.requestQueue = requestQueue;
    this.bitmapPool = bitmapPool;
    this.memoryCache = memoryCache;

    dataLoadProviderFactory = new DataLoadProviderFactory();
    dataLoadProviderFactory.register(InputStream.class, Bitmap.class, new StreamBitmapDataLoadProvider(bitmapPool));

    dataLoadProviderFactory.register(ParcelFileDescriptor.class, Bitmap.class,
            new FileDescriptorBitmapDataLoadProvider(bitmapPool));

    ImageVideoDataLoadProvider imageVideoDataLoadProvider = new ImageVideoDataLoadProvider(bitmapPool);
    dataLoadProviderFactory.register(ImageVideoWrapper.class, Bitmap.class, imageVideoDataLoadProvider);

    GifDataLoadProvider gifDataLoadProvider = new GifDataLoadProvider(context, bitmapPool);
    dataLoadProviderFactory.register(ImageVideoWrapper.class, GifBitmapWrapper.class,
            new ImageVideoGifDataLoadProvider(imageVideoDataLoadProvider, gifDataLoadProvider));

    register(File.class, ParcelFileDescriptor.class, new FileDescriptorFileLoader.Factory());
    register(File.class, InputStream.class, new StreamFileLoader.Factory());
    register(Integer.class, ParcelFileDescriptor.class, new FileDescriptorResourceLoader.Factory());
    register(Integer.class, InputStream.class, new StreamResourceLoader.Factory());
    register(String.class, ParcelFileDescriptor.class, new FileDescriptorStringLoader.Factory());
    register(String.class, InputStream.class, new StreamStringLoader.Factory());
    register(Uri.class, ParcelFileDescriptor.class, new FileDescriptorUriLoader.Factory());
    register(Uri.class, InputStream.class, new StreamUriLoader.Factory());
    register(URL.class, InputStream.class, new StreamUrlLoader.Factory());
    register(GlideUrl.class, InputStream.class, new VolleyUrlLoader.Factory(requestQueue));

    transcoderFactory.register(Bitmap.class, BitmapDrawable.class,
            new BitmapDrawableTranscoder(context.getResources(), bitmapPool));
    transcoderFactory.register(GifBitmapWrapper.class, Drawable.class,
            new GifBitmapDrawableTranscoder(context));
}
项目:devfestnorte-app    文件:EngineJob.java   
public EngineJob(Key key, MemoryCache cache, Handler mainHandler, boolean isCacheable, EngineJobListener listener) {
    this.key = key;
    this.cache = cache;
    this.isCacheable = isCacheable;
    this.listener = listener;
    this.mainHandler = mainHandler;
}
项目:devfestnorte-app    文件:Engine.java   
Engine(ResourceRunnerFactory factory, MemoryCache cache, Map<Key, ResourceRunner> runners, KeyFactory keyFactory) {
    this.factory = factory;
    this.cache = cache;
    this.runners = runners;
    this.keyFactory = keyFactory;

    cache.setResourceRemovedListener(this);
}
项目:devfestnorte-app    文件:DefaultResourceRunnerFactory.java   
public DefaultResourceRunnerFactory(MemoryCache memoryCache, DiskCache diskCache, Handler mainHandler,
        ExecutorService service, Handler bgHandler ) {
    this.memoryCache = memoryCache;
    this.diskCache = diskCache;
    this.mainHandler = mainHandler;
    this.service = service;
    this.bgHandler = bgHandler;
}
项目:saarang-iosched    文件:Glide.java   
Glide(Engine engine, RequestQueue requestQueue, MemoryCache memoryCache, BitmapPool bitmapPool,
        Context context) {
    this.engine = engine;
    this.requestQueue = requestQueue;
    this.bitmapPool = bitmapPool;
    this.memoryCache = memoryCache;

    dataLoadProviderFactory = new DataLoadProviderFactory();
    dataLoadProviderFactory.register(InputStream.class, Bitmap.class, new StreamBitmapDataLoadProvider(bitmapPool));

    dataLoadProviderFactory.register(ParcelFileDescriptor.class, Bitmap.class,
            new FileDescriptorBitmapDataLoadProvider(bitmapPool));

    ImageVideoDataLoadProvider imageVideoDataLoadProvider = new ImageVideoDataLoadProvider(bitmapPool);
    dataLoadProviderFactory.register(ImageVideoWrapper.class, Bitmap.class, imageVideoDataLoadProvider);

    GifDataLoadProvider gifDataLoadProvider = new GifDataLoadProvider(context, bitmapPool);
    dataLoadProviderFactory.register(ImageVideoWrapper.class, GifBitmapWrapper.class,
            new ImageVideoGifDataLoadProvider(imageVideoDataLoadProvider, gifDataLoadProvider));

    register(File.class, ParcelFileDescriptor.class, new FileDescriptorFileLoader.Factory());
    register(File.class, InputStream.class, new StreamFileLoader.Factory());
    register(Integer.class, ParcelFileDescriptor.class, new FileDescriptorResourceLoader.Factory());
    register(Integer.class, InputStream.class, new StreamResourceLoader.Factory());
    register(String.class, ParcelFileDescriptor.class, new FileDescriptorStringLoader.Factory());
    register(String.class, InputStream.class, new StreamStringLoader.Factory());
    register(Uri.class, ParcelFileDescriptor.class, new FileDescriptorUriLoader.Factory());
    register(Uri.class, InputStream.class, new StreamUriLoader.Factory());
    register(URL.class, InputStream.class, new StreamUrlLoader.Factory());
    register(GlideUrl.class, InputStream.class, new VolleyUrlLoader.Factory(requestQueue));

    transcoderFactory.register(Bitmap.class, BitmapDrawable.class,
            new BitmapDrawableTranscoder(context.getResources(), bitmapPool));
    transcoderFactory.register(GifBitmapWrapper.class, Drawable.class,
            new GifBitmapDrawableTranscoder(context));
}
项目:saarang-iosched    文件:EngineJob.java   
public EngineJob(Key key, MemoryCache cache, Handler mainHandler, boolean isCacheable, EngineJobListener listener) {
    this.key = key;
    this.cache = cache;
    this.isCacheable = isCacheable;
    this.listener = listener;
    this.mainHandler = mainHandler;
}
项目:saarang-iosched    文件:Engine.java   
Engine(ResourceRunnerFactory factory, MemoryCache cache, Map<Key, ResourceRunner> runners, KeyFactory keyFactory) {
    this.factory = factory;
    this.cache = cache;
    this.runners = runners;
    this.keyFactory = keyFactory;

    cache.setResourceRemovedListener(this);
}
项目:saarang-iosched    文件:DefaultResourceRunnerFactory.java   
public DefaultResourceRunnerFactory(MemoryCache memoryCache, DiskCache diskCache, Handler mainHandler,
        ExecutorService service, Handler bgHandler ) {
    this.memoryCache = memoryCache;
    this.diskCache = diskCache;
    this.mainHandler = mainHandler;
    this.service = service;
    this.bgHandler = bgHandler;
}
项目:GitHub    文件:BitmapPreFiller.java   
public BitmapPreFiller(MemoryCache memoryCache, BitmapPool bitmapPool,
    DecodeFormat defaultFormat) {
  this.memoryCache = memoryCache;
  this.bitmapPool = bitmapPool;
  this.defaultFormat = defaultFormat;
}
项目:GitHub    文件:BitmapPreFillRunner.java   
public BitmapPreFillRunner(BitmapPool bitmapPool, MemoryCache memoryCache,
    PreFillQueue allocationOrder) {
  this(bitmapPool, memoryCache, allocationOrder, DEFAULT_CLOCK,
      new Handler(Looper.getMainLooper()));
}
项目:GitHub    文件:Engine.java   
Engine(MemoryCache cache,
    DiskCache.Factory diskCacheFactory,
    GlideExecutor diskCacheExecutor,
    GlideExecutor sourceExecutor,
    GlideExecutor sourceUnlimitedExecutor,
    Map<Key, EngineJob<?>> jobs,
    EngineKeyFactory keyFactory,
    Map<Key, WeakReference<EngineResource<?>>> activeResources,
    EngineJobFactory engineJobFactory,
    DecodeJobFactory decodeJobFactory,
    ResourceRecycler resourceRecycler) {
  this.cache = cache;
  this.diskCacheProvider = new LazyDiskCacheProvider(diskCacheFactory);

  if (activeResources == null) {
    activeResources = new HashMap<>();
  }
  this.activeResources = activeResources;

  if (keyFactory == null) {
    keyFactory = new EngineKeyFactory();
  }
  this.keyFactory = keyFactory;

  if (jobs == null) {
    jobs = new HashMap<>();
  }
  this.jobs = jobs;

  if (engineJobFactory == null) {
    engineJobFactory = new EngineJobFactory(diskCacheExecutor, sourceExecutor,
        sourceUnlimitedExecutor, this);
  }
  this.engineJobFactory = engineJobFactory;

  if (decodeJobFactory == null) {
    decodeJobFactory = new DecodeJobFactory(diskCacheProvider);
  }
  this.decodeJobFactory = decodeJobFactory;

  if (resourceRecycler == null) {
    resourceRecycler = new ResourceRecycler();
  }
  this.resourceRecycler = resourceRecycler;

  cache.setResourceRemovedListener(this);
}
项目:GitHub    文件:BitmapPreFiller.java   
public BitmapPreFiller(MemoryCache memoryCache, BitmapPool bitmapPool,
    DecodeFormat defaultFormat) {
  this.memoryCache = memoryCache;
  this.bitmapPool = bitmapPool;
  this.defaultFormat = defaultFormat;
}
项目:GitHub    文件:BitmapPreFillRunner.java   
@SuppressWarnings("WeakerAccess")
public BitmapPreFillRunner(BitmapPool bitmapPool, MemoryCache memoryCache,
    PreFillQueue allocationOrder) {
  this(bitmapPool, memoryCache, allocationOrder, DEFAULT_CLOCK,
      new Handler(Looper.getMainLooper()));
}
项目:GitHub    文件:Engine.java   
@VisibleForTesting
Engine(MemoryCache cache,
    DiskCache.Factory diskCacheFactory,
    GlideExecutor diskCacheExecutor,
    GlideExecutor sourceExecutor,
    GlideExecutor sourceUnlimitedExecutor,
    GlideExecutor animationExecutor,
    Map<Key, EngineJob<?>> jobs,
    EngineKeyFactory keyFactory,
    ActiveResources activeResources,
    EngineJobFactory engineJobFactory,
    DecodeJobFactory decodeJobFactory,
    ResourceRecycler resourceRecycler) {
  this.cache = cache;
  this.diskCacheProvider = new LazyDiskCacheProvider(diskCacheFactory);

  if (activeResources == null) {
    activeResources = new ActiveResources();
  }
  this.activeResources = activeResources;
  activeResources.setListener(this);

  if (keyFactory == null) {
    keyFactory = new EngineKeyFactory();
  }
  this.keyFactory = keyFactory;

  if (jobs == null) {
    jobs = new HashMap<>();
  }
  this.jobs = jobs;

  if (engineJobFactory == null) {
    engineJobFactory =
        new EngineJobFactory(
            diskCacheExecutor, sourceExecutor, sourceUnlimitedExecutor, animationExecutor, this);
  }
  this.engineJobFactory = engineJobFactory;

  if (decodeJobFactory == null) {
    decodeJobFactory = new DecodeJobFactory(diskCacheProvider);
  }
  this.decodeJobFactory = decodeJobFactory;

  if (resourceRecycler == null) {
    resourceRecycler = new ResourceRecycler();
  }
  this.resourceRecycler = resourceRecycler;

  cache.setResourceRemovedListener(this);
}
项目:saarang-iosched    文件:GlideBuilder.java   
public GlideBuilder setMemoryCache(MemoryCache memoryCache) {
    this.memoryCache = memoryCache;
    return this;
}
项目:saarang-iosched    文件:EngineBuilder.java   
public EngineBuilder(MemoryCache memoryCache, DiskCache diskCache) {
    this.memoryCache = memoryCache;
    this.diskCache = diskCache;
}
项目:AppDevFestSudeste2015    文件:GlideBuilder.java   
public GlideBuilder setMemoryCache(MemoryCache memoryCache) {
    this.memoryCache = memoryCache;
    return this;
}
项目:AppDevFestSudeste2015    文件:EngineBuilder.java   
public EngineBuilder(MemoryCache memoryCache, DiskCache diskCache) {
    this.memoryCache = memoryCache;
    this.diskCache = diskCache;
}
项目:devfestnorte-app    文件:GlideBuilder.java   
public GlideBuilder setMemoryCache(MemoryCache memoryCache) {
    this.memoryCache = memoryCache;
    return this;
}
项目:devfestnorte-app    文件:EngineBuilder.java   
public EngineBuilder(MemoryCache memoryCache, DiskCache diskCache) {
    this.memoryCache = memoryCache;
    this.diskCache = diskCache;
}
项目:saarang-iosched    文件:GlideBuilder.java   
public GlideBuilder setMemoryCache(MemoryCache memoryCache) {
    this.memoryCache = memoryCache;
    return this;
}
项目:saarang-iosched    文件:EngineBuilder.java   
public EngineBuilder(MemoryCache memoryCache, DiskCache diskCache) {
    this.memoryCache = memoryCache;
    this.diskCache = diskCache;
}
项目:GitHub    文件:GlideBuilder.java   
/**
 * Sets the {@link com.bumptech.glide.load.engine.cache.MemoryCache} implementation to store
 * {@link com.bumptech.glide.load.engine.Resource}s that are not currently in use.
 *
 * @param memoryCache The cache to use.
 * @return This builder.
 */
public GlideBuilder setMemoryCache(MemoryCache memoryCache) {
  this.memoryCache = memoryCache;
  return this;
}