use of com.facebook.imagepipeline.listener.RequestListener2 in project fresco by facebook.
the class ImagePipeline method submitPrefetchRequest.
private DataSource<Void> submitPrefetchRequest(Producer<Void> producerSequence, ImageRequest imageRequest, ImageRequest.RequestLevel lowestPermittedRequestLevelOnSubmit, @Nullable Object callerContext, Priority priority, @Nullable RequestListener requestListener) {
final RequestListener2 requestListener2 = new InternalRequestListener(getRequestListenerForRequest(imageRequest, requestListener), mRequestListener2);
if (mCallerContextVerifier != null) {
mCallerContextVerifier.verifyCallerContext(callerContext, true);
}
try {
ImageRequest.RequestLevel lowestPermittedRequestLevel = ImageRequest.RequestLevel.getMax(imageRequest.getLowestPermittedRequestLevel(), lowestPermittedRequestLevelOnSubmit);
SettableProducerContext settableProducerContext = new SettableProducerContext(imageRequest, generateUniqueFutureId(), requestListener2, callerContext, lowestPermittedRequestLevel, /* isPrefetch */
true, /* isIntermediateResultExpected */
false, priority, mConfig);
return ProducerToDataSourceAdapter.create(producerSequence, settableProducerContext, requestListener2);
} catch (Exception exception) {
return DataSources.immediateFailedDataSource(exception);
}
}
use of com.facebook.imagepipeline.listener.RequestListener2 in project fresco by facebook.
the class ImagePipeline method submitFetchRequest.
private <T> DataSource<CloseableReference<T>> submitFetchRequest(Producer<CloseableReference<T>> producerSequence, ImageRequest imageRequest, ImageRequest.RequestLevel lowestPermittedRequestLevelOnSubmit, @Nullable Object callerContext, @Nullable RequestListener requestListener, @Nullable String uiComponentId) {
if (FrescoSystrace.isTracing()) {
FrescoSystrace.beginSection("ImagePipeline#submitFetchRequest");
}
final RequestListener2 requestListener2 = new InternalRequestListener(getRequestListenerForRequest(imageRequest, requestListener), mRequestListener2);
if (mCallerContextVerifier != null) {
mCallerContextVerifier.verifyCallerContext(callerContext, false);
}
try {
ImageRequest.RequestLevel lowestPermittedRequestLevel = ImageRequest.RequestLevel.getMax(imageRequest.getLowestPermittedRequestLevel(), lowestPermittedRequestLevelOnSubmit);
SettableProducerContext settableProducerContext = new SettableProducerContext(imageRequest, generateUniqueFutureId(), uiComponentId, requestListener2, callerContext, lowestPermittedRequestLevel, /* isPrefetch */
false, imageRequest.getProgressiveRenderingEnabled() || !UriUtil.isNetworkUri(imageRequest.getSourceUri()), imageRequest.getPriority(), mConfig);
return CloseableProducerToDataSourceAdapter.create(producerSequence, settableProducerContext, requestListener2);
} catch (Exception exception) {
return DataSources.immediateFailedDataSource(exception);
} finally {
if (FrescoSystrace.isTracing()) {
FrescoSystrace.endSection();
}
}
}
Aggregations