Example usage for com.facebook.react.views.imagehelper ImageSource ImageSource

List of usage examples for com.facebook.react.views.imagehelper ImageSource ImageSource

Introduction

In this page you can find the example usage for com.facebook.react.views.imagehelper ImageSource ImageSource.

Prototype

public ImageSource(Context context, String source) 

Source Link

Usage

From source file:com.horcrux.svg.ImageView.java

License:Open Source License

@Override
void draw(final Canvas canvas, final Paint paint, final float opacity) {
    if (!mLoading.get()) {
        final ImageSource imageSource = new ImageSource(mContext, uriString);

        final ImageRequest request = ImageRequestBuilder.newBuilderWithSource(imageSource.getUri()).build();
        if (Fresco.getImagePipeline().isInBitmapMemoryCache(request)) {
            tryRender(request, canvas, paint, opacity * mOpacity);
        } else {//from ww  w.ja  v a 2 s . c  o  m
            loadBitmap(request);
        }
    }
}