android-glide

Glide V4 load https images

空扰寡人 提交于 2019-12-05 18:05:40
I know this link , and tried but this is for Glide V3 solution, I need to load https://myimage/image/xxx.png but glide throw exception FileNotFoundException(No content provider)** and **SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found I am using 4.5.0 Glide version, I have spend a lot of time but can't find any solution, any help will be appreciated. I am struggling near about 1 day but find solution, if you are using ssl certified link like https then you need to add two more dependency of glide so you have to add this

how to use GlideModule on Glide 4?

末鹿安然 提交于 2019-12-05 15:13:02
问题 I recently update my app to use Glide 4, to be precise, Glide 4.2.0. gradle: compile 'com.github.bumptech.glide:glide:4.2.0' annotationProcessor 'com.github.bumptech.glide:compiler:4.2.0' compile ('com.github.bumptech.glide:okhttp3-integration:4.2.0'){ exclude group: 'glide-parent' } in manifest: <meta-data android:name="com.xxx.MyGlideModule" android:value="GlideModule"/> GlideModule class: @GlideModule public class MyGlideModule extends AppGlideModule { @Override public void

android.graphics.drawable.TransitionDrawable cannot be cast to com.bumptech.glide.load.resource.bitmap.GlideBitmapDrawable

ⅰ亾dé卋堺 提交于 2019-12-05 14:31:16
I have loaded remote image to ImageView using below code Glide.with(context) .load(imageUrl) .placeholder(R.drawable.placeholderImage) .into(holder.wallPaperImageView); Now I want to get the bitmap from imageview Bitmap bitmap = ((GlideBitmapDrawable)holder.wallPaperImageView.getDrawable()).getBitmap(); but above line of code throws below exception: java.lang.ClassCastException: android.graphics.drawable.TransitionDrawable cannot be cast to com.bumptech.glide.load.resource.bitmap.GlideBitmapDrawable How to resolve this? Vindhya Pratap Singh Use this instead of that: Bitmap bmp = (

How to invalidate Glide cache for some specific images

对着背影说爱祢 提交于 2019-12-05 14:23:58
I'm writing an app which needs to load a lot of images from the internet (a manga reader). I need to cache some thumbnail images for offline use, any others should be cleared when app closed. I read some about cache invalidation on Glide page, they said the best way is to change the content url, but how Glide know if it is a modified url of old content or a new one? I'm new to Glide here. https://github.com/bumptech/glide/wiki/Caching-and-Cache-Invalidation Thank in advance :) KasoGG You can use following to load image: Glide.with(context) .signature(new StringSignature(yourVersionMetadata))

Android memory leak with Glide

倖福魔咒の 提交于 2019-12-05 14:19:41
I have an activity which loads pictures in ImageViews with glide. Here is a sample of my glide code: Glide.with(ImageVOne.getContext()) .load(geoInfo.getPhotoUrl1()) .skipMemoryCache(true) .priority(Priority.NORMAL) .into(ImageVOne); I load from 1 to 35 pictures, each picture should be between 150ko & 250ko. I cannot reduce that. This activity can be accessed several times in a session from the main activity, and each time it loads different pictures. For example the first time it will be pictures of Washington, then pictures of London etc. My issue is that the use of memory increases a lot

Load already fetched image when offline in Glide for Android

不羁的心 提交于 2019-12-05 14:18:53
Am using Glide version 4.8.0 And for loading an image I do this GlideApp .with(HomePageFragment.this) .load(remoteURL) .diskCacheStrategy(DiskCacheStrategy.ALL) .into(mImageView); When the device is connected to Internet the image loades successfully but when device goes offline , how to load the same image from cache that was already featched from the remoteURL ? My CustomAppGlideModule looks like this @GlideModule public class CustomAppGlideModule extends AppGlideModule { @Override public void applyOptions(@NonNull Context context, @NonNull GlideBuilder builder) { builder.setMemoryCache(new

Glide: log each request

戏子无情 提交于 2019-12-05 06:24:56
Consider the code below: Glide.with(<your_context>) .load(<remote_file_url, local_file_path>) .into(<imageview>); Above Glide code is written in lots of file. Simply I want to log my remote_file_url or local_file_path in logcat. But I don't want to change the code in every file. Is Glide allowing logging? If it allows, then I need a simple central way to turn on glide logging. For Reference: I want the way like Retrofit + okhttp allow. In OkHttp , I just have to add interceptor at one location and it will log information about each webservice call without writing any other additional code. In

Loading image with glide is slow

萝らか妹 提交于 2019-12-05 05:52:40
I have app connect with server and when pics load seems so slow and when scroll that up and down seems glide want read image again! This is my adapter of glide: DataAdapter : public class DataAdapter extends RecyclerView.Adapter<DataAdapter.ViewHolder> { private Context context; private ArrayList<AndroidVersion> android; public DataAdapter(Context context,ArrayList<AndroidVersion> android) { this.context = context; this.android = android; } @Override public DataAdapter.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) { View view = LayoutInflater.from(viewGroup.getContext()).inflate(R

Placeholder/Error/Fallback in Glide v4 [duplicate]

一曲冷凌霜 提交于 2019-12-05 05:47:34
This question already has answers here : Glide-4.0.0 Missing placeholder, error, GlideApp and does not resolve its method placeholder,error (8 answers) Closed last year . i am using latest version of Glide as of now which is glide:4.0.0-RC1 and not able to find methods like placeholder, error, fallback e.t.c. Probably they have provided alternate for it but i am not getting it. Anybody know about there alternatives in this release? try this RequestOptions requestOptions = new RequestOptions(); requestOptions.placeholder(R.mipmap.ic_launcher); requestOptions.error(R.drawable.error_img); Glide

How to load URL image in android wear?

时光总嘲笑我的痴心妄想 提交于 2019-12-05 01:26:10
Right now I am using Glide-library to load the image in Android Wear. It doesn't load the image in most of the times. However, it loads image sometimes. Don't know what going wrong in my code. Note Wear is connected to the device via Bluetooth and I successfully get JSON response of Webservice in Android Wear via Broadcast Receiver from mobile. All data are displayed properly in wear except the images. Glide.with(mContext) .load("http://www.hanamoflorist.ca/images/uploads/Spring5InchesCubeVaseArrangement$45.00.jpg") .listener(new RequestListener<String, GlideDrawable>() { @Override public