本文整理汇总了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()));
}
示例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));
}
示例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)
)
);
}
示例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());
}
示例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));
}
示例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()));
}
示例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());
}
示例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));
}
示例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()));
}
示例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());
}
示例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()));
}
示例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()));
}
示例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));
}
示例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()));
}
示例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));
}