You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue details / Repro steps / Use case background:
I've found that with version 4.4 sometimes images don’t load. I must point out that this happens rarely, but as it happens I think was better to report it. The loading process is in a very simple RecyclerView with no complex code, which at the present time only displays a very small number of items, not even enough to scroll.
Glide load line / GlideModule (if any) / list Adapter code (if any):
public class AdapterThumbnails extends RecyclerView.Adapter<ThumbnailViewHolder>
{
private static final String ASSETS_PATH = "file:///android_asset/thumbnails/";
private final String[] mTestList = new String[]{"0.jpg", "1.jpg", "2.jpg"};
private final Context mContext;
private final int mMaxSize;
public AdapterThumbnails(final Context context, final int maxSize)
{
this.mContext = context;
this.mMaxSize = maxSize;
}
@Override
public long getItemId(final int position)
{
return position;
}
@Override
public int getItemCount()
{
return this.mTestList.length;
}
@Override
public ThumbnailViewHolder onCreateViewHolder(final ViewGroup parent, final int viewType)
{
final ImageView newView = new ImageView(this.mContext);
newView.setLayoutParams(new ViewGroup.LayoutParams(this.mMaxSize, this.mMaxSize));
return new ThumbnailViewHolder(newView);
}
@Override
public void onBindViewHolder(final ThumbnailViewHolder holder, final int position)
{
final ImageView thumbnail = (ImageView)holder.itemView;
final Uri uri = Uri.parse(AdapterThumbnails.ASSETS_PATH + this.mTestList[position]);
GlideApp.with(this.mContext)
.asBitmap()
.load(uri)
.diskCacheStrategy(DiskCacheStrategy.NONE)
.override(this.mMaxSize, this.mMaxSize)
.into(thumbnail);
}
@Override
public void onViewRecycled(final ThumbnailViewHolder holder)
{
GlideApp.with(this.mContext).clear(holder.itemView);
}
}
For this project this is the only place where we use it, as this specific project is still at a very early stage.
In case it is of any use, next is the code of the Glide Module we are using:
@GlideModule
public final class GlideManager extends AppGlideModule
{
@Override
public boolean isManifestParsingEnabled()
{
return false;
}
@Override
public void applyOptions(final Context context, final GlideBuilder builder)
{
final int sizeMemory = 40 * 1024 * 1024; // 40 MB
builder.setMemoryCache(new LruResourceCache(sizeMemory));
final int sizeDisk = 75 * 1024 * 1024; // 75 MB
builder.setDiskCache(new InternalCacheDiskCacheFactory(context, sizeDisk));
}
}
Thanks for the detailed information, super helpful. I believe this is fixed in d427cbd. You can try out the latest snapshot when it finishes building by following the instructions here: http://bumptech.github.io/glide/dev/snapshots.html
Glide Version: 4.4
Device/Android Version: Nexus 5X / 7.1.2
Issue details / Repro steps / Use case background:
I've found that with version 4.4 sometimes images don’t load. I must point out that this happens rarely, but as it happens I think was better to report it. The loading process is in a very simple RecyclerView with no complex code, which at the present time only displays a very small number of items, not even enough to scroll.
Glide load line /
GlideModule
(if any) / list Adapter code (if any):Stack trace / LogCat:
The text was updated successfully, but these errors were encountered: