fresco icon indicating copy to clipboard operation
fresco copied to clipboard

Requesting progressive rendering

Open csabatini opened this issue 11 years ago • 6 comments

From the progressive rendering section in the docs:

Uri uri;
ImageRequest request = ImageRequestBuilder
    .newBuilderWithSource(uri)
    .setProgressiveRenderingEnabled(true)
    .build();
PipelineDraweeController controller = Fresco.newControllerBuilder()
    .setImageRequest(requests)
    .setOldController(mSimpleDraweeView.getController())
    .build();
mSimpleDraweeView.setController(controller);

It looks as if there is no Fresco.newControllerBuilder, only Fresco.newDraweeControllerBuilder(). And with that modification, the assignment to PipelineDraweeController gives an incompatible types error.

Just a note as this sample code might want to be tweaked for clarity. It seems to compile and work with a DraweeController type.

csabatini avatar Mar 28 '15 16:03 csabatini

Yeah, there was a typo in the documentation. This has been fixed now.

plamenko avatar Mar 28 '15 21:03 plamenko

The documentation does not appear to have been fixed. The code in the docs link is the same as stated above and the problem still exists.

LarsLiden avatar Jun 16 '15 21:06 LarsLiden

@LarsLiden, the code in the link above is: http://frescolib.org/docs/progressive-jpegs.html and is not the same as stated above. Which code are you looking at?

IanChilds avatar Jun 16 '15 21:06 IanChilds

Thanks for your response, Ian. newDraweeControllerBuilder seems to return a PipelineDraweeControllerBuilder object, not a DraweeController so the code below triggers a compile error. If instead you change the code so controller is of type PipelineDraweeControllerBuilder, then the setController call fails as it expects a DraweeController.

Does that make sense?

DraweeController controller = Fresco.newDraweeControllerBuilder() . setImageRequest(request) .setOldController(mSimpleDraweeView.getController ()) .build(); mSimpleDraweeView.setController(controller);

On Tue, Jun 16, 2015 at 2:40 PM, IanChilds [email protected] wrote:

@LarsLiden https://github.com/LarsLiden, the code in the link above is: http://frescolib.org/docs/progressive-jpegs.html and is not the same as stated above. Which code are you looking at?

— Reply to this email directly or view it on GitHub https://github.com/facebook/fresco/issues/25#issuecomment-112576630.

LarsLiden avatar Jun 16 '15 21:06 LarsLiden

The build() method will return you a PipelineDraweeController from the PipelineDraweeControllerBuilder, which can be passed to the SimpleDraweeView.

IanChilds avatar Jun 16 '15 21:06 IanChilds

Ah. Got it. Thanks and sorry for the confusion.

On Tue, Jun 16, 2015 at 2:59 PM, IanChilds [email protected] wrote:

The build() method will return you a PipelineDraweeController from the PipelineDraweeControllerBuilder, which can be passed to the SimpleDraweeView.

— Reply to this email directly or view it on GitHub https://github.com/facebook/fresco/issues/25#issuecomment-112580964.

LarsLiden avatar Jun 16 '15 22:06 LarsLiden