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


Java Registry.replace方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例6: registerComponents

import com.bumptech.glide.Registry; //导入方法依赖的package包/类
@Override
public void registerComponents(Context context, Glide glide, Registry registry) {
    super.registerComponents(context, glide, registry);
    //Glide defaults to using HttpURLConnection to make a network request, where you switch to okhttp request
    registry.replace(GlideUrl.class, InputStream.class, new OkHttpUrlLoader.Factory(RepositoryUtils.INSTANCE.obtainRepositoryComponent(context).okHttpClient()));
}
 
开发者ID:goutham106,项目名称:GmArchMvvm,代码行数:7,代码来源:GlideConfiguration.java

示例7: 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());
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:OkHttpLibraryGlideModule.java

示例8: registerComponents

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

示例9: registerComponents

import com.bumptech.glide.Registry; //导入方法依赖的package包/类
@Override
public void registerComponents(Context context, Glide glide, Registry registry) {
    BaseApplication application = (BaseApplication) context.getApplicationContext();
    //Glide 底层默认使用 HttpConnection 进行网络请求,这里替换为 Okhttp 后才能使用本框架,进行 Glide 的加载进度监听
    registry.replace(GlideUrl.class, InputStream.class, new OkHttpUrlLoader.Factory(application.getOkHttpClient()));
}
 
开发者ID:JessYanCoding,项目名称:ProgressManager,代码行数:7,代码来源:GlideConfiguration.java

示例10: 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());
}
 
开发者ID:gejiaheng,项目名称:Protein,代码行数:5,代码来源:OKHttpLibraryGlideModule.java

示例11: registerComponents

import com.bumptech.glide.Registry; //导入方法依赖的package包/类
@Override
public void registerComponents(Context context, Glide glide, Registry registry) {
    //Glide 默认使用 HttpURLConnection 做网络请求,在这切换成 Okhttp 请求
    AppComponent appComponent = ArmsUtils.obtainAppComponentFromContext(context);
    registry.replace(GlideUrl.class, InputStream.class, new OkHttpUrlLoader.Factory(appComponent.okHttpClient()));
}
 
开发者ID:Superingxz,项目名称:MoligyMvpArms,代码行数:7,代码来源:GlideConfiguration.java

示例12: registerComponents

import com.bumptech.glide.Registry; //导入方法依赖的package包/类
@Override
public void registerComponents(Context context, Glide glide, Registry registry) {
    //Glide默认使用HttpURLConnection做网络请求,在这切换成okhttp请求
    AppComponent appComponent = ((App) context.getApplicationContext()).getAppComponent();
    registry.replace(GlideUrl.class, InputStream.class, new OkHttpUrlLoader.Factory(appComponent.okHttpClient()));
}
 
开发者ID:devzwy,项目名称:NeiHanDuanZiTV,代码行数:7,代码来源:GlideConfiguration.java

示例13: 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);
  registry.replace(AppModel.class, InputStream.class, new AppIconLoaderFactory(context));
}
 
开发者ID:afollestad,项目名称:arctic-icon-request,代码行数:7,代码来源:AppIconGlideModule.java

示例14: registerComponents

import com.bumptech.glide.Registry; //导入方法依赖的package包/类
@Override
public void registerComponents(Context context, Glide glide, Registry registry) {
    // Glide默认使用HttpURLConnection做网络请求,在这切换成Okhttp请求
    AppComponent appComponent = AppUtils.obtainAppComponentFromContext(context);
    registry.replace(GlideUrl.class, InputStream.class, new OkHttpUrlLoader.Factory(appComponent.getOkHttpClient()));
}
 
开发者ID:RockyQu,项目名称:MVPFrames,代码行数:7,代码来源:GlideConfiguration.java

示例15: registerComponents

import com.bumptech.glide.Registry; //导入方法依赖的package包/类
@Override public void registerComponents(Context context, Registry registry) {
	okhttp3.OkHttpClient client = new OkHttpClient.Builder().build();
	registry.replace(GlideUrl.class, InputStream.class, new OkHttpUrlLoader.Factory(client));
}
 
开发者ID:TWiStErRob,项目名称:glide-support,代码行数:5,代码来源:GlobalOkHttpGlideModule.java


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