У меня есть этот URL-сервер:
"http://10.0.2.2:5000/image/img_lights.jpg"
Я хочу добавить "http://10.0.2.2:5000"
по умолчанию в мой GlideModule.
Поэтому, когда я вызываю Glide, мне нужно просто пройти "/image/img_lights.jpg"
Glide.with(this).load("/image/img_lights.jpg").into(imageViewProfile);
Что я должен добавить к своему модулю?
@GlideModule
public class MyAppGlideModule extends AppGlideModule {
@Override
public boolean isManifestParsingEnabled() {
return super.isManifestParsingEnabled();
}
@Override
public void registerComponents(@NonNull Context context, @NonNull Glide glide, @NonNull Registry registry) {
super.registerComponents(context, glide, registry);
OkHttpClient client = new OkHttpClient.Builder().addInterceptor(new ServiceInterceptor()).build();
registry.replace(GlideUrl.class, InputStream.class, new OkHttpUrlLoader.Factory(client));
}
}