DraweeRequestHelper( ImageRequest imageRequest, @Nullable ImageRequest cachedImageRequest, ControllerListener listener) { AbstractDraweeControllerBuilder controllerBuilder = sControllerBuilder .setImageRequest(imageRequest) .setCallerContext(RCTImageView.getCallerContext()) .setControllerListener(listener); if (cachedImageRequest != null) { controllerBuilder.setLowResImageRequest(cachedImageRequest); } DraweeController controller = controllerBuilder.build(); controller.setHierarchy(sHierarchyBuilder.build()); mDraweeController = controller; }
public FrescoBasedReactTextInlineImageSpan( Resources resources, int height, int width, @Nullable Uri uri, ReadableMap headers, AbstractDraweeControllerBuilder draweeControllerBuilder, @Nullable Object callerContext) { mDraweeHolder = new DraweeHolder( GenericDraweeHierarchyBuilder.newInstance(resources) .build() ); mDraweeControllerBuilder = draweeControllerBuilder; mCallerContext = callerContext; mHeight = height; mWidth = width; mUri = (uri != null) ? uri : Uri.EMPTY; mHeaders = headers; }
public FrescoBasedReactTextInlineImageSpan( Resources resources, int height, int width, @Nullable Uri uri, AbstractDraweeControllerBuilder draweeControllerBuilder, @Nullable Object callerContext) { mDraweeHolder = new DraweeHolder( GenericDraweeHierarchyBuilder.newInstance(resources) .build() ); mDraweeControllerBuilder = draweeControllerBuilder; mCallerContext = callerContext; mHeight = height; mWidth = width; mUri = (uri != null) ? uri : Uri.EMPTY; }
public static ImageRequest.RequestLevel convertCacheLevelToRequestLevel( AbstractDraweeControllerBuilder.CacheLevel cacheLevel) { switch (cacheLevel) { case FULL_FETCH: return ImageRequest.RequestLevel.FULL_FETCH; case DISK_CACHE: return ImageRequest.RequestLevel.DISK_CACHE; case BITMAP_MEMORY_CACHE: return ImageRequest.RequestLevel.BITMAP_MEMORY_CACHE; default: throw new RuntimeException("Cache level" + cacheLevel + "is not supported. "); } }
public VolleyDataSource( final ImageLoader imageLoader, final Uri imageRequest, final AbstractDraweeControllerBuilder.CacheLevel cacheLevel) { String uriString = imageRequest.toString(); int maxWidth = 0; int maxHeight = 0; if (cacheLevel != AbstractDraweeControllerBuilder.CacheLevel.FULL_FETCH) { if (!imageLoader.isCached(uriString, maxWidth, maxHeight)) { mImageContainer = null; setFailure(new NullPointerException("Image not found in bitmap-cache.")); return; } } mImageContainer = imageLoader.get( uriString, new ImageLoader.ImageListener() { @Override public void onErrorResponse(VolleyError error) { setFailure(error.getCause()); } @Override public void onResponse(final ImageLoader.ImageContainer response, boolean isImmediate) { if (response.getBitmap() != null) { setResult(response.getBitmap(), true); } } }, maxWidth, maxHeight); }
@Override public void setImageURI(Uri uri, @Nullable Object callerContext) { SimpleDraweeControllerBuilder controllerBuilder = getControllerBuilder() .setUri(uri) .setCallerContext(callerContext) .setOldController(getController()); if (controllerBuilder instanceof AbstractDraweeControllerBuilder) { ((AbstractDraweeControllerBuilder<?,?,?,?>) controllerBuilder) .setControllerListener(mListener); } setController(controllerBuilder.build()); }
@Override public void setImageURI(Uri uri, @Nullable Object callerContext) { SimpleDraweeControllerBuilder controllerBuilder = getControllerBuilder() .setUri(uri) .setCallerContext(callerContext) .setOldController(getController()); if (mConfig.instrumentationEnabled && controllerBuilder instanceof AbstractDraweeControllerBuilder) { ((AbstractDraweeControllerBuilder<?,?,?,?>) controllerBuilder) .setControllerListener(mListener); } setController(controllerBuilder.build()); }
public ReactImageView( Context context, AbstractDraweeControllerBuilder draweeControllerBuilder, @Nullable Object callerContext) { super(context, buildHierarchy(context)); mScaleType = ImageResizeMode.defaultValue(); mDraweeControllerBuilder = draweeControllerBuilder; mRoundedCornerPostprocessor = new RoundedCornerPostprocessor(); mCallerContext = callerContext; mSources = new LinkedList<>(); }
public ReactImageManager( AbstractDraweeControllerBuilder draweeControllerBuilder, Object callerContext) { mDraweeControllerBuilder = draweeControllerBuilder; mCallerContext = callerContext; mResourceDrawableIdHelper = new ResourceDrawableIdHelper(); }
public ReactImageView( Context context, AbstractDraweeControllerBuilder draweeControllerBuilder, @Nullable Object callerContext) { super(context, buildHierarchy(context)); mScaleType = ImageResizeMode.defaultValue(); mDraweeControllerBuilder = draweeControllerBuilder; mRoundedCornerPostprocessor = new RoundedCornerPostprocessor(); mCallerContext = callerContext; }
@Override public void setImageURI(Uri uri) { super.setImageURI(uri); SimpleDraweeControllerBuilder controllerBuilder = getControllerBuilder().setUri(uri); if (controllerBuilder instanceof AbstractDraweeControllerBuilder) { ((AbstractDraweeControllerBuilder) controllerBuilder).setControllerListener(mControllerListener); } setController(controllerBuilder.build()); }
public RNImageWand( Context context, AbstractDraweeControllerBuilder draweeControllerBuilder, @Nullable Object callerContext) { super(context, buildHierarchy(context)); mScaleType = ImageResizeMode.defaultValue(); mDraweeControllerBuilder = draweeControllerBuilder; mRoundedCornerPostprocessor = new RoundedCornerPostprocessor(); mCallerContext = callerContext; }
public ImageAndroidView( Context context, AbstractDraweeControllerBuilder draweeControllerBuilder, @Nullable Object callerContext) { super(context, buildHierarchy(context)); mScaleType = ImageResizeMode.defaultValue(); mDraweeControllerBuilder = draweeControllerBuilder; mRoundedCornerPostprocessor = new RoundedCornerPostprocessor(); mCallerContext = callerContext; }
@Override protected DataSource<CloseableReference<CloseableImage>> getDataSourceForRequest( ImageRequest imageRequest, Object callerContext, AbstractDraweeControllerBuilder.CacheLevel cacheLevel) { return mImagePipeline.fetchDecodedImage( imageRequest, callerContext, convertCacheLevelToRequestLevel(cacheLevel)); }
public void setListener(AbstractDraweeControllerBuilder controllerBuilder) { if (mConfig.instrumentationEnabled) { controllerBuilder.setControllerListener(mListener); } }
static void setDraweeControllerBuilder(AbstractDraweeControllerBuilder builder) { sControllerBuilder = builder; }
public RCTImageViewManager( AbstractDraweeControllerBuilder draweeControllerBuilder, Object callerContext) { mDraweeControllerBuilder = draweeControllerBuilder; mCallerContext = callerContext; }
public AbstractDraweeControllerBuilder getDraweeControllerBuilder() { if (mDraweeControllerBuilder == null) { mDraweeControllerBuilder = Fresco.newDraweeControllerBuilder(); } return mDraweeControllerBuilder; }
public FrescoBasedReactTextInlineImageShadowNode( AbstractDraweeControllerBuilder draweeControllerBuilder, @Nullable Object callerContext) { mDraweeControllerBuilder = draweeControllerBuilder; mCallerContext = callerContext; }
public AbstractDraweeControllerBuilder getDraweeControllerBuilder() { return mDraweeControllerBuilder; }
public FrescoBasedReactTextInlineImageViewManager( @Nullable AbstractDraweeControllerBuilder draweeControllerBuilder, @Nullable Object callerContext) { mDraweeControllerBuilder = draweeControllerBuilder; mCallerContext = callerContext; }
public ReactImageManager( AbstractDraweeControllerBuilder draweeControllerBuilder, Object callerContext) { mDraweeControllerBuilder = draweeControllerBuilder; mCallerContext = callerContext; }