当前位置: 首页>>代码示例>>Java>>正文


Java Registry类代码示例

本文整理汇总了Java中com.bumptech.glide.Registry的典型用法代码示例。如果您正苦于以下问题:Java Registry类的具体用法?Java Registry怎么用?Java Registry使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Registry类属于com.bumptech.glide包,在下文中一共展示了Registry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: registerComponents

import com.bumptech.glide.Registry; //导入依赖的package包/类
@Override
public void registerComponents(Context context, Glide glide, Registry registry) {
    HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor();
    loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BASIC);
    OkHttpClient client = new OkHttpClient.Builder()
            .readTimeout(30, TimeUnit.SECONDS)
            .connectTimeout(30, TimeUnit.SECONDS)
            .addInterceptor(loggingInterceptor)
            .build();
    registry.replace(GlideUrl.class, InputStream.class, new OkHttpUrlLoader.Factory(client));
}
 
开发者ID:YMlion,项目名称:leisure-glance,代码行数:12,代码来源:GankGlideModule.java

示例2: registerComponents

import com.bumptech.glide.Registry; //导入依赖的package包/类
@Override public void registerComponents( @NonNull Context context, @NonNull Glide glide, @NonNull Registry registry) {
	// デフォルト実装は何もしないらしい
	super.registerComponents( context,glide,registry );
	
	// App1を初期化してからOkHttp3Factoryと連動させる
	App1.Companion.prepare( context.getApplicationContext() );
	App1.Companion.registerGlideComponents(context,glide,registry);
}
 
开发者ID:tateisu,项目名称:SubwayTooter,代码行数:9,代码来源:MyAppGlideModule.java

示例3: registerComponents

import com.bumptech.glide.Registry; //导入依赖的package包/类
@Override
public void registerComponents(Context context, Glide glide, Registry registry) {
    super.registerComponents(context, glide, registry);
    //Glide默认使用HttpURLConnection做网络请求,在这切换成okhttp请求
    registry.replace(GlideUrl.class, InputStream.class,
            new OkHttpUrlLoader.Factory(RepositoryUtils.INSTANCE.obtainRepositoryComponent(context).okHttpClient()));
}
 
开发者ID:xiaobailong24,项目名称:MVVMArms,代码行数:8,代码来源:GlideConfiguration.java

示例4: registerComponents

import com.bumptech.glide.Registry; //导入依赖的package包/类
@Override
public void registerComponents(Context context, Glide glide, Registry registry) {
    registry.replace(
            GlideUrl.class,
            InputStream.class,
            new OkHttpUrlLoader.Factory(
                    request -> GlobalApplication.getOkHttpClient().newCall(request)
            )
    );
}
 
开发者ID:moko256,项目名称:twicalico,代码行数:11,代码来源:GlideModule.java

示例5: registerComponents

import com.bumptech.glide.Registry; //导入依赖的package包/类
@Override
public void registerComponents(Context context, Registry registry) {
    registry.register(Bitmap.class, PalettizedBitmapDrawable.class,
            PalettizedBitmapDrawableTranscoder.create(context));
    registry.register(Bitmap.class, Palette.class,
            PaletteBitmapTranscoder.create());
}
 
开发者ID:OpenSilk,项目名称:Orpheus,代码行数:8,代码来源:PalettizedBitmapGlideModule.java

示例6: registerComponents

import com.bumptech.glide.Registry; //导入依赖的package包/类
@Override
public void registerComponents(Context context, Registry registry) {
  registry.replace(GlideUrl.class, InputStream.class, new OkHttpUrlLoader.Factory());
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:OkHttpGlideModule.java

示例7: registerComponents

import com.bumptech.glide.Registry; //导入依赖的package包/类
@Override
public void registerComponents(Context context, Registry registry) {
  registry.replace(GlideUrl.class, InputStream.class, new VolleyUrlLoader.Factory(context));
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:VolleyLibraryGlideModule.java

示例8: registerComponents

import com.bumptech.glide.Registry; //导入依赖的package包/类
@Override
public void registerComponents(Context context, Registry registry) {
  registry.register(SVG.class, PictureDrawable.class, new SvgDrawableTranscoder())
      .append(InputStream.class, SVG.class, new SvgDecoder());
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:6,代码来源:SvgModule.java

示例9: registerComponents

import com.bumptech.glide.Registry; //导入依赖的package包/类
@Override
public void registerComponents(Context context, Registry registry) {
  registry.append(Api.GifResult.class, InputStream.class, new GiphyModelLoader.Factory());
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:GiphyGlideModule.java

示例10: registerComponents

import com.bumptech.glide.Registry; //导入依赖的package包/类
@Override
public void registerComponents(Context context, Registry registry) {
  registry.append(Photo.class, InputStream.class, new FlickrModelLoader.Factory());
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:FlickrGlideModule.java

示例11: registerComponents

import com.bumptech.glide.Registry; //导入依赖的package包/类
@Override
public void registerComponents(Context context, Registry registry) {
  // Default empty impl.
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:LibraryGlideModule.java

示例12: getModelLoaders

import com.bumptech.glide.Registry; //导入依赖的package包/类
List<ModelLoader<File, ?>> getModelLoaders(File file)
    throws Registry.NoModelLoaderAvailableException {
  return glideContext.getRegistry().getModelLoaders(file);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:DecodeHelper.java

示例13: getSourceEncoder

import com.bumptech.glide.Registry; //导入依赖的package包/类
<X> Encoder<X> getSourceEncoder(X data) throws Registry.NoSourceEncoderAvailableException {
  return glideContext.getRegistry().getSourceEncoder(data);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:4,代码来源:DecodeHelper.java

示例14: onResourceDecoded

import com.bumptech.glide.Registry; //导入依赖的package包/类
@Override
public Resource<Z> onResourceDecoded(Resource<Z> decoded) {
  Class<Z> resourceSubClass = getResourceClass(decoded);
  Transformation<Z> appliedTransformation = null;
  Resource<Z> transformed = decoded;
  if (dataSource != DataSource.RESOURCE_DISK_CACHE) {
    appliedTransformation = decodeHelper.getTransformation(resourceSubClass);
    transformed = appliedTransformation.transform(glideContext, decoded, width, height);
  }
  // TODO: Make this the responsibility of the Transformation.
  if (!decoded.equals(transformed)) {
    decoded.recycle();
  }

  final EncodeStrategy encodeStrategy;
  final ResourceEncoder<Z> encoder;
  if (decodeHelper.isResourceEncoderAvailable(transformed)) {
    encoder = decodeHelper.getResultEncoder(transformed);
    encodeStrategy = encoder.getEncodeStrategy(options);
  } else {
    encoder = null;
    encodeStrategy = EncodeStrategy.NONE;
  }

  Resource<Z> result = transformed;
  boolean isFromAlternateCacheKey = !decodeHelper.isSourceKey(currentSourceKey);
  if (diskCacheStrategy.isResourceCacheable(isFromAlternateCacheKey, dataSource,
      encodeStrategy)) {
    if (encoder == null) {
      throw new Registry.NoResultEncoderAvailableException(transformed.get().getClass());
    }
    final Key key;
    if (encodeStrategy == EncodeStrategy.SOURCE) {
      key = new DataCacheKey(currentSourceKey, signature);
    } else if (encodeStrategy == EncodeStrategy.TRANSFORMED) {
      key = new ResourceCacheKey(currentSourceKey, signature, width, height,
          appliedTransformation, resourceSubClass, options);
    } else {
      throw new IllegalArgumentException("Unknown strategy: " + encodeStrategy);
    }

    LockedResource<Z> lockedResult = LockedResource.obtain(transformed);
    deferredEncodeManager.init(key, encoder, lockedResult);
    result = lockedResult;
  }
  return result;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:48,代码来源:DecodeJob.java

示例15: registerComponents

import com.bumptech.glide.Registry; //导入依赖的package包/类
@Override
public void registerComponents(Context context, Registry registry) {
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:4,代码来源:ManifestParserTest.java


注:本文中的com.bumptech.glide.Registry类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。