JPEG Streaming with Fresco using DraweeController
suggest changeThis example assumes that you have already added Fresco to your app (see this example):
SimpleDraweeView img = new SimpleDraweeView(context);
ImageRequest request = ImageRequestBuilder
.newBuilderWithSource(Uri.parse("http://example.com/image.png"))
.setProgressiveRenderingEnabled(true) // This is where the magic happens.
.build();
DraweeController controller = Fresco.newDraweeControllerBuilder()
.setImageRequest(request)
.setOldController(img.getController()) // Get the current controller from our SimpleDraweeView.
.build();
img.setController(controller); // Set the new controller to the SimpleDraweeView to enable progressive JPEGs.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents