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

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

Introduction

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

Prototype

public Uri getUri() 

Source Link

Document

Get the URI for this image - can be either a parsed network URI or a resource URI.

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 {//  w  w  w . j  a v  a2s. com
            loadBitmap(request);
        }
    }
}