Tabnine Logo
MemorySizeCalculator$Builder.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
com.bumptech.glide.load.engine.cache.MemorySizeCalculator$Builder
constructor

Best Java code snippets using com.bumptech.glide.load.engine.cache.MemorySizeCalculator$Builder.<init> (Showing top 5 results out of 315)

origin: bumptech/glide

MemorySizeCalculator getCalculator() {
 when(screenDimensions.getWidthPixels()).thenReturn(pixelSize);
 when(screenDimensions.getHeightPixels()).thenReturn(pixelSize);
 return new MemorySizeCalculator.Builder(RuntimeEnvironment.application)
   .setMemoryCacheScreens(memoryCacheScreens)
   .setBitmapPoolScreens(bitmapPoolScreens)
   .setMaxSizeMultiplier(sizeMultiplier)
   .setActivityManager(activityManager)
   .setScreenDimensions(screenDimensions)
   .setArrayPoolSize(byteArrayPoolSizeBytes)
   .build();
}
origin: bumptech/glide

memorySizeCalculator = new MemorySizeCalculator.Builder(context).build();
origin: JessYanCoding/MVPArms

@Override
public void applyOptions(@NonNull Context context, @NonNull GlideBuilder builder) {
  final AppComponent appComponent = ArmsUtils.obtainAppComponentFromContext(context);
  builder.setDiskCache(new DiskCache.Factory() {
    @Override
    public DiskCache build() {
      // Careful: the external cache directory doesn't enforce permissions
      return DiskLruCacheWrapper.create(DataHelper.makeDirs(new File(appComponent.cacheFile(), "Glide")), IMAGE_DISK_CACHE_MAX_SIZE);
    }
  });
  MemorySizeCalculator calculator = new MemorySizeCalculator.Builder(context).build();
  int defaultMemoryCacheSize = calculator.getMemoryCacheSize();
  int defaultBitmapPoolSize = calculator.getBitmapPoolSize();
  int customMemoryCacheSize = (int) (1.2 * defaultMemoryCacheSize);
  int customBitmapPoolSize = (int) (1.2 * defaultBitmapPoolSize);
  builder.setMemoryCache(new LruResourceCache(customMemoryCacheSize));
  builder.setBitmapPool(new LruBitmapPool(customBitmapPoolSize));
  //将配置 Glide 的机会转交给 GlideImageLoaderStrategy,如你觉得框架提供的 GlideImageLoaderStrategy
  //并不能满足自己的需求,想自定义 BaseImageLoaderStrategy,那请你最好实现 GlideAppliesOptions
  //因为只有成为 GlideAppliesOptions 的实现类,这里才能调用 applyGlideOptions(),让你具有配置 Glide 的权利
  BaseImageLoaderStrategy loadImgStrategy = appComponent.imageLoader().getLoadImgStrategy();
  if (loadImgStrategy != null && loadImgStrategy instanceof GlideAppliesOptions) {
    ((GlideAppliesOptions) loadImgStrategy).applyGlideOptions(context, builder);
  }
}
origin: mozilla-tw/Rocket

memorySizeCalculator = new MemorySizeCalculator.Builder(context).build();
origin: JessYanCoding/MVPArt

@Override
public void applyOptions(@NonNull Context context, @NonNull GlideBuilder builder) {
  final AppComponent appComponent = ArtUtils.obtainAppComponentFromContext(context);
  builder.setDiskCache(new DiskCache.Factory() {
    @Override
    public DiskCache build() {
      // Careful: the external cache directory doesn't enforce permissions
      return DiskLruCacheWrapper.create(DataHelper.makeDirs(new File(appComponent.cacheFile(), "Glide")), IMAGE_DISK_CACHE_MAX_SIZE);
    }
  });
  MemorySizeCalculator calculator = new MemorySizeCalculator.Builder(context).build();
  int defaultMemoryCacheSize = calculator.getMemoryCacheSize();
  int defaultBitmapPoolSize = calculator.getBitmapPoolSize();
  int customMemoryCacheSize = (int) (1.2 * defaultMemoryCacheSize);
  int customBitmapPoolSize = (int) (1.2 * defaultBitmapPoolSize);
  builder.setMemoryCache(new LruResourceCache(customMemoryCacheSize));
  builder.setBitmapPool(new LruBitmapPool(customBitmapPoolSize));
  //将配置 Glide 的机会转交给 GlideImageLoaderStrategy,如你觉得框架提供的 GlideImageLoaderStrategy
  //并不能满足自己的需求,想自定义 BaseImageLoaderStrategy,那请你最好实现 GlideAppliesOptions
  //因为只有成为 GlideAppliesOptions 的实现类,这里才能调用 applyGlideOptions(),让你具有配置 Glide 的权利
  BaseImageLoaderStrategy loadImgStrategy = appComponent.imageLoader().getLoadImgStrategy();
  if (loadImgStrategy != null && loadImgStrategy instanceof GlideAppliesOptions) {
    ((GlideAppliesOptions) loadImgStrategy).applyGlideOptions(context, builder);
  }
}
com.bumptech.glide.load.engine.cacheMemorySizeCalculator$Builder<init>

Popular methods of MemorySizeCalculator$Builder

  • build
  • setActivityManager
  • setArrayPoolSize
  • setBitmapPoolScreens
  • setMaxSizeMultiplier
  • setMemoryCacheScreens
  • setScreenDimensions

Popular in Java

  • Updating database using SQL prepared statement
  • requestLocationUpdates (LocationManager)
  • setRequestProperty (URLConnection)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now