use of com.facebook.imagepipeline.request.ImageRequestBuilder in project boxing by Bilibili.
the class BoxingFrescoLoader method displayRaw.
@Override
public void displayRaw(@NonNull ImageView img, @NonNull String absPath, IBoxingCallback callback) {
absPath = "file://" + absPath;
ImageRequestBuilder requestBuilder = ImageRequestBuilder.newBuilderWithSource(Uri.parse(absPath));
ImageRequest request = requestBuilder.build();
loadImage(request, img, callback);
}
use of com.facebook.imagepipeline.request.ImageRequestBuilder in project fresco by facebook.
the class DraweeViewHolder method bind.
/**
* @param uri The Uri to show into the DraweeView for this Holder
*/
public void bind(Uri uri) {
mDraweeView.initInstrumentation(uri.toString(), mPerfListener);
ImageRequestBuilder imageRequestBuilder = ImageRequestBuilder.newBuilderWithSource(uri).setResizeOptions(new ResizeOptions(mDraweeView.getLayoutParams().width, mDraweeView.getLayoutParams().height));
PipelineUtil.addOptionalFeatures(imageRequestBuilder, mConfig);
// Create the Builder
PipelineDraweeControllerBuilder builder = Fresco.newDraweeControllerBuilder().setImageRequest(imageRequestBuilder.build());
if (mConfig.reuseOldController) {
builder.setOldController(mDraweeView.getController());
}
mDraweeView.setListener(builder);
mDraweeView.setController(builder.build());
}
use of com.facebook.imagepipeline.request.ImageRequestBuilder in project fresco by facebook.
the class DraweeViewListAdapter method getView.
@Override
public View getView(int position, View convertView, ViewGroup parent) {
InstrumentedDraweeView draweeView;
if (convertView == null) {
final Context context = parent.getContext();
GenericDraweeHierarchy gdh = DraweeUtil.createDraweeHierarchy(context, mConfig);
draweeView = new InstrumentedDraweeView(context, gdh, mConfig);
SizeUtil.setConfiguredSize(parent, draweeView, mConfig);
draweeView.setPadding(mPaddingPx, mPaddingPx, mPaddingPx, mPaddingPx);
} else {
draweeView = (InstrumentedDraweeView) convertView;
}
final Uri uri = getItem(position);
draweeView.initInstrumentation(uri.toString(), mPerfListener);
ImageRequestBuilder imageRequestBuilder = ImageRequestBuilder.newBuilderWithSource(uri).setResizeOptions(new ResizeOptions(draweeView.getLayoutParams().width, draweeView.getLayoutParams().height));
PipelineUtil.addOptionalFeatures(imageRequestBuilder, mConfig);
// Create the Builder
PipelineDraweeControllerBuilder builder = Fresco.newDraweeControllerBuilder().setImageRequest(imageRequestBuilder.build());
if (mConfig.reuseOldController) {
builder.setOldController(draweeView.getController());
}
if (mConfig.instrumentationEnabled) {
draweeView.setListener(builder);
}
draweeView.setController(builder.build());
return draweeView;
}
use of com.facebook.imagepipeline.request.ImageRequestBuilder in project fresco by facebook.
the class ImagePipelineUtilsImpl method createEncodedImageRequestBuilder.
@Nullable
protected ImageRequestBuilder createEncodedImageRequestBuilder(@Nullable Uri uri, EncodedImageOptions imageOptions) {
if (uri == null) {
return null;
}
ImageRequestBuilder builder = ImageRequestBuilder.newBuilderWithSource(uri);
maybeSetRequestPriority(builder, imageOptions.getPriority());
return builder;
}
use of com.facebook.imagepipeline.request.ImageRequestBuilder in project fresco by facebook.
the class ImagePipelineUtilsImpl method createEncodedImageRequestBuilder.
@Nullable
protected ImageRequestBuilder createEncodedImageRequestBuilder(ImageRequest imageRequest, EncodedImageOptions imageOptions) {
if (imageRequest == null) {
return null;
}
ImageRequestBuilder builder = ImageRequestBuilder.fromRequest(imageRequest);
maybeSetRequestPriority(builder, imageOptions.getPriority());
return builder;
}
Aggregations