I am trying to show images from URL.
In my code I used, imageLoader.get
function but loading images are too slow.
imageLoader.get(c.getImgUrl(), ImageLoader.getImageListener(holder.mImage, R.drawable.img_loading, R.drawable.img_loading)); //450x200 px images.
Then I tried to compress but the problem is still alive.
imageLoader.get(c.getImgUrl(), ImageLoader.getImageListener(holder.mImage, R.drawable.img_loading, R.drawable.img_loading),225,100);
Besides, images are not shown in correct order firstly. When I scroll down(I show 20 images at the same time with recycler view), at first glance it shows images in wrong order. After 3-4 seconds, it shows correctly. Images changes automatically if I scroll down.
As a result, How can I solve my problem? How to speed up? How to show in correct order at first glance?
You can use Glide for that which is far better in memory consumption than compared to other libraries. Also, it provides the diskCacheStrategy, imageResizing, centerCropping, placeholder for the image if not available and can set error image or message if error loading image occurs.
Below is the latest dependency you can include in you app level build.gradle file:
implementation 'com.github.bumptech.glide:glide:4.7.1'