I'm developing a gallery screen to allow the user to select some images from device and send to another user. I'm using Fresco to load the images but, depending of the device, the images are loading very slowly and the scroll on the screen is slow too.
Initially, I was loading the image this way:
Uri uriPhoto = Uri.parse("file://" + photoGallery.imageUri);
holder.draweeView.setImageURI(uriPhoto);
Then I found the setResizeOptions():
Uri uriPhoto = Uri.parse("file://" + photoGallery.imageUri);
ImageRequest request = ImageRequestBuilder.newBuilderWithSource(uriPhoto)
.setResizeOptions(new ResizeOptions(60, 60))
.build();
PipelineDraweeController controller = (PipelineDraweeController) Fresco.newDraweeControllerBuilder()
.setOldController(holder.draweeView.getController())
.setImageRequest(request)
.build();
holder.draweeView.setController(controller);
It works, but, as the documentation says:
It will slow down your decodes and possibly the rest of your app, as it's CPU-intensive
The result isn't what I, as user, expects.
Anyone knows how to solve this problem?
Thanks!
setDownsampleEnabledinstead ofsetResizeOptions. Accordingly to the doc, it is supposed to be way more efficient - BlackbeltApplication, right? - rsicarelli